Showing posts with label System Environment variables. Show all posts
Showing posts with label System Environment variables. Show all posts

Saturday, July 28, 2012

Working with System Environment variables

 
System Environment variables are two types

1)User Variables
2)System Variables

*********************************************************************************
User  Variables :
*********************************************************************************
          In user specific, user or admin can declare the variables

Syntax:


Set Obj = CreateObject("wscript.shell")
set objEnv = Obj.Environment("User")
sUserName = objEnv.Item("UserName")  'these variable should be declare in User environment variables

*********************************************************************************
System  Variables :
*********************************************************************************
         In System specific only admin can declare the variables

  Syntax:


  Set Obj = CreateObject("wscript.shell")
  set objEnv = Obj.Environment("System")
  sUserName = objEnv.Item("UserName") 'these variable should be declare in System environment variables

*********************************************************************************