saxobob Posted August 11, 2005 Report Share Posted August 11, 2005 Hello, Is there a way I can access windows env variables and store them into ME. A useful list of all of them is at... http://kennethhunt.com/archives/000933.html Specifically now I'm looking for Username, but I can imagine needing others in the future. Obviously lots are covered by specific commands, but not all, as far as I can see. Thanks, Rob Quote Link to comment Share on other sites More sharing options...
randallc Posted August 11, 2005 Report Share Posted August 11, 2005 Hi, Here's an example of putting some of your list into strings; or just displaying them in a text box; <TVAR2:01:01:%DATE%><TVAR2:02:01:%ERRORLEVEL%><TVAR2:03:01:%HOMEDRIVE%><TVAR2:04:01:%HOMEPATH%><TVAR2:05:01:%USERNAME%><TBOX4:T:1:000152000253000827000333:000:CD=%CD%APPDATA=%APPDATA% CD=%CD% CMDCMDLINE=%CMDCMDLINE% CMDEXTVERSION=%CMDEXTVERSION% COMPUTERNAME=%COMPUTERNAME% T1=%T1% T2=%T2% T3=%T3% T4=%T4% T5=%T5%> Variable Set String %T1% "%DATE%"Variable Set String %T2% "%ERRORLEVEL%" Variable Set String %T3% "%HOMEDRIVE%" Variable Set String %T4% "%HOMEPATH%" Variable Set String %T5% "%USERNAME%" Text Box Display: [use the first box, the 'code", to copyinto script editor, not the script!] Best,Randall Quote Link to comment Share on other sites More sharing options...
saxobob Posted August 11, 2005 Author Report Share Posted August 11, 2005 Excellent - easier than I thought! I thought I might need to go to a DOS prompt. Many thanks Rob Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.