slightly_abnormal Posted April 2, 2006 Share Posted April 2, 2006 How do I run a folder, using a variable e.g Opt("ExpandEnvStrings", 1) $var2 = "notepad.exe" run($var2) $var1 = "%appdata%" run($var1) $var3 = "c:\" run($var3) I've tried the _rundos, and the run(@comspec, but i think they were totally off this itself$var2 = "notepad.exe" run($var2) works without a hitch but folders are another thing.. Link to comment Share on other sites More sharing options...
cppman Posted April 2, 2006 Share Posted April 2, 2006 (edited) run("explorer.exe c:\") or using variables: run("explorer.exe " & $myvar) hope that helps Edited April 2, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
slightly_abnormal Posted April 2, 2006 Author Share Posted April 2, 2006 (edited) it didn't work Opt("ExpandEnvStrings", 1) $var2 = "notepad.exe" run($var2) $var1 = "%appdata%" run("explorer.exe" & $var1) $var2 = "c:\" run("explorer.exe" & $var2) Edited April 2, 2006 by slightly_abnormal Link to comment Share on other sites More sharing options...
forger Posted April 2, 2006 Share Posted April 2, 2006 "explorer.exe " and NOT "explorer.exe" ( you forgot the space! ) Opt("ExpandEnvStrings", 1) $var2 = "notepad.exe" run($var2) $var1 = "%appdata%" run("explorer.exe " & $var1) $var2 = "c:\" run("explorer.exe " & $var2) Link to comment Share on other sites More sharing options...
slightly_abnormal Posted April 2, 2006 Author Share Posted April 2, 2006 ahh i see.. thanks for the help guys Link to comment Share on other sites More sharing options...
greenmachine Posted April 2, 2006 Share Posted April 2, 2006 Alternatively you can use Run (@ComSpec & " /c start C:\"). Link to comment Share on other sites More sharing options...
slightly_abnormal Posted April 2, 2006 Author Share Posted April 2, 2006 (edited) Alternatively you can use Run (@ComSpec & " /c start C:\"). oops.. how can i avoid the security dialog when I run a shortcut? Opt("ExpandEnvStrings", 1) $var2 = "notepad.lnk" run("explorer.exe " & $var2) Edited April 2, 2006 by slightly_abnormal Link to comment Share on other sites More sharing options...
greenmachine Posted April 2, 2006 Share Posted April 2, 2006 oops.. how can i avoid the security dialog when I run a shortcut? Opt("ExpandEnvStrings", 1) $var2 = "notepad.lnk" run("explorer.exe " & $var2) Run (@ComSpec & ' /c "' & $var2 & '"') ; added surrounding quotes just in case there's a space. Link to comment Share on other sites More sharing options...
slightly_abnormal Posted April 2, 2006 Author Share Posted April 2, 2006 Run (@ComSpec & ' /c "' & $var2 & '"') ; added surrounding quotes just in case there's a space.cool, thanks 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