chuck Posted March 26, 2009 Share Posted March 26, 2009 Hallo to every AutoIt User I have a little problem using the run command When I m typing the command like this run("explorer.exe c:\temp") everything is ok But When I m giving $temp = "C:\temp" run("explorer.exe" & $temp) or many combinations with single or double quotes I cannot have the same result as the first run hardcoded ... Any Help Appreciated Sorry if this is very easy for someone i tried many things before asking Thaks a Lot Link to comment Share on other sites More sharing options...
youknowwho4eva Posted March 26, 2009 Share Posted March 26, 2009 (edited) The way you have it written would return run("explorer.exec:\temp") instead of run("explorer.exe c:\temp") What you want is $temp = " C:\temp" < note the space run("explorer.exe" & $temp) or $temp = "C:\temp" run("explorer.exe " & $temp) < space here Edit, typo Edited March 26, 2009 by youknowwho4eva Giggity Link to comment Share on other sites More sharing options...
chuck Posted March 26, 2009 Author Share Posted March 26, 2009 My Friend youknowwho4eva thanks for your quick answer but It's still not working even i tried the clever thing you proposed run("explorer.exe c:\temp") opens me the contents of c:\temp directory $temp = " c:\temp" leaving a space as you said run("explorer.exe" & $temp) is not working at all Link to comment Share on other sites More sharing options...
youknowwho4eva Posted March 26, 2009 Share Posted March 26, 2009 All ways worked with me. Even without the space... Giggity Link to comment Share on other sites More sharing options...
GaRydelaMer Posted March 26, 2009 Share Posted March 26, 2009 run('explorer.exe "c:\program files"') this work fine too Link to comment Share on other sites More sharing options...
SilkroakGEEK Posted March 26, 2009 Share Posted March 26, 2009 $dir = "C:\WINDOWS\system32" run("calc.exe", $dir) this one works for me! Link to comment Share on other sites More sharing options...
Soru Posted March 26, 2009 Share Posted March 26, 2009 I've personally always used $temp = "c:\temp" ShellExecute($temp) [b][/b] Link to comment Share on other sites More sharing options...
chuck Posted March 27, 2009 Author Share Posted March 27, 2009 Thanks everyone the shellexecute solution fits best for my case But I m sure that theres a way with the run command We ll see in the future Link to comment Share on other sites More sharing options...
ResNullius Posted March 28, 2009 Share Posted March 28, 2009 Thanks everyone the shellexecute solution fits best for my case But I m sure that theres a way with the run command We ll see in the future$temp = "C:\temp" run('explorer.exe "' & $temp & '"') 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