Jump to content
Macro Express Forums

Accessing Windows Environment Variables


saxobob
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...