Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to take a value defined by the set command in DOS

Status
Not open for further replies.

cparralesl

Programmer
Jan 27, 2002
118
NI
Hello Guys,

A value was set in DOS ej: Set ThisVar=PcName. If I try to get the value from that variable using vbScript, comeup an empty value in my Msgbox. If i try to get the value under DOS mode manually, it works. If i use WSH, returns anempty value.

Has anyone try to get that kind of variables value?

I really appreciate your help about ti.

Regards,

Cesar Humberto Parrales
Application Support
 
get the value from that variable using vbScript
Which code ?
How is the VBS program launched ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Sorry,

Set wshShell = Wscript.createobject("wscript.shell")
Set FSO = CreateObject("Scripting.FileSystemObject")

'msgbox WshShell.ExpandEnvironmentStrings("%cparrales%")
msgbox WshShell.Environment

Help will be appreciated.

Regards

Cesar Humberto Parrales
Application Support
 
This would be the currect code:

Set wshShell = Wscript.createobject("wscript.shell")
Set FSO = CreateObject("Scripting.FileSystemObject")

msgbox WshShell.ExpandEnvironmentStrings("%cparrales%")


Cesar Humberto Parrales
Application Support
 
Have a look at the WshShell.Environment collection.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top