Delebre 0 Posted March 7, 2014 I have a quick script that I wrote, that I was hoping to make future compatible by using environmental variables in Windows 7. Here is my script: Run("Explorer.exe " & "C:\Users\TheDude\Shortcuts") WinWaitActive("Shortcuts") Send("+!0") I have an environmental variable set in Windows. It's: %Shortcuts% However, when I tried this: Run("Explorer.exe " & "%Shortcuts%") WinWaitActive("Shortcuts") Send("+!0") It does not work. So I'm clearly missing something. One more thing, I can't make this work without adding that space between Explorer.exe and the second " that you can see in both my scripts. If I take out the space it doesn't work period. Any clarification would be helpful. Thanks! Share this post Link to post Share on other sites
jdelaney 313 Posted March 7, 2014 one way: Run("Explorer.exe " & EnvGet("Shortcuts")) IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Share this post Link to post Share on other sites
orbs 201 Posted March 7, 2014 hello Delebre, welcome to AutoIt and to the forum! in addition to using EnvGet() as jdelaney said, be aware that explorer.exe is very "special" when it comes to command-line switches. take a close look here: http://support.microsoft.com/kb/314853 you'll end-up with something like this: Run("Explorer.exe /n," & EnvGet("Shortcuts")) b.t.w if you just want to open a folder, you do not need to call explorer.exe at all: ShellExecute(EnvGet("Shortcuts")) Share this post Link to post Share on other sites
Delebre 0 Posted March 7, 2014 Hey guys! Thank you for getting back to me so quickly! I'm blown away I will try that out right now. Share this post Link to post Share on other sites