phatzilla Posted January 10, 2007 Share Posted January 10, 2007 (edited) Okay i know this is like such a simple command but for some reason something isnt working out Run("1.exe", @SystemDir & "\Hello" , @SW_MAXIMIZE) All it's supposed to do is run the file 1.exe @ c:\Windows\system32\hello\1.exe. (The directory exists). It always tells me it cant find the specified file (The file also exists). What's up? Edited January 10, 2007 by phatzilla Link to comment Share on other sites More sharing options...
ThaSatelliteGuy Posted January 10, 2007 Share Posted January 10, 2007 Okay i know this is like such a simple command but for some reason something isnt working out Run("1.exe", @SystemDir & "\Hello" , @SW_MAXIMIZE) All it's supposed to do is run the file 1.exe @ c:\Windows\system32\hello\1.exe. (The directory exists). It always tells me it cant find the specified file (The file also exists). What's up?Run The Following and you'll see the error of your ways! MsgBox(0,"Cursor Position:",@SystemDir & "\Hello") Link to comment Share on other sites More sharing options...
xcal Posted January 10, 2007 Share Posted January 10, 2007 Is the file located at \windows\system32? Might want to try: Run(@SystemDir & "\Hello\1.exe", @SystemDir, @SW_MAXIMIZE) How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
phatzilla Posted January 10, 2007 Author Share Posted January 10, 2007 still doesnt work even with Run("1.exe", @SystemDir & "\Hello\" , @SW_MAXIMIZE) Link to comment Share on other sites More sharing options...
phatzilla Posted January 10, 2007 Author Share Posted January 10, 2007 Is the file located at \windows\system32? Might want to try: Run(@SystemDir & "\Hello\1.exe", @SystemDir, @SW_MAXIMIZE) Thank you that fixed it. But why is the 'filename' refered to as "@SystemDir & "\Hello\1.exe"". I thought the filename is just that, the name of the file which is 1.exe, i didnt know i had to stick the extra directory in there. Thanks though. Link to comment Share on other sites More sharing options...
SAG Posted January 10, 2007 Share Posted January 10, 2007 From the Help file.... To run DOS (console) commands, try Run(@ComSpec & " /c " & 'commandName', "", @SW_HIDE) So for your example, try Run(@ComSpec & " /c " & @SystemDir & "\Hello\1.exe", "", @SW_MAXIMIZE) Link to comment Share on other sites More sharing options...
ThaSatelliteGuy Posted January 10, 2007 Share Posted January 10, 2007 still doesnt work even with Run("1.exe", @SystemDir & "\Hello\" , @SW_MAXIMIZE) Correct Code Shoud Be: Run(@SystemDir & "\hello\" & "1.exe","", @SW_MAXIMIZE) Area after first comma is root dir not path to prog Link to comment Share on other sites More sharing options...
ThaSatelliteGuy Posted January 10, 2007 Share Posted January 10, 2007 Correct Code Shoud Be:Run(@SystemDir & "\hello\" & "1.exe","", @SW_MAXIMIZE)Area after first comma is root dir not path to prog Mine works fine..... SAG's advice is for COMMANDS....NOT PROGS 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