Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Writing envionment variables

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,3260
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Writing envionment variables
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Writing envionment variables - 6/6/2005 6:05:19 AM   
  bnichols

 

Posts: 4
Score: 0
Joined: 1/11/2005
From:
Status: offline
I am trying to take the following environment variables from a DOS script and have VBScript write them to a workstation running W2k. I can find plenty of scripts for reading current settings but nothing on setting or adding to the current environment. Thanks for your help.

SET PATH="K:\APPS\FIIS\SQL32\DLL"
SET PATH="\\scc6\BFIAPPS\APPS\FIIS\DDDK"
SET SYBASE="\\scc6\BFIAPPS\APPS\FIIS\SQL32"
SET PATH="C:\orawin95\bin"
 
 
Post #: 1
 
 Re: Writing envionment variables - 6/6/2005 6:13:11 AM   
  fosterr_2000

 

Posts: 115
Score: 0
Joined: 12/18/2004
From:
Status: offline
Here is one example:

Set wshShell = WScript.CreateObject("WScript.Shell")
Set WshEnv = WshShell.Environment ("Volatile")
WshEnv ("SYBASE") = "\\scc6\BFIAPPS\APPS\FIIS\SQL32"

This will set the environment variable SYBASE for the user that will be avalible until it is cleared or the user logs off.

Hope this helps.

(in reply to bnichols)
 
 
Post #: 2
 
 Re: Writing envionment variables - 6/6/2005 6:58:52 AM   
  bnichols

 

Posts: 4
Score: 0
Joined: 1/11/2005
From:
Status: offline
Thank You.

(in reply to bnichols)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Writing envionment variables Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts