Delebre Posted March 7, 2014 Share 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! Link to comment Share on other sites More sharing options...
jdelaney Posted March 7, 2014 Share 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. Link to comment Share on other sites More sharing options...
orbs Posted March 7, 2014 Share 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")) Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
Delebre Posted March 7, 2014 Author Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now