BigDog Posted August 9, 2008 Share Posted August 9, 2008 Dear Sir there is a line in my script showed below $myChildAPP = Run("SMS_1.exe", @WorkingDir, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) she works well now , but my question is : 1) suppose there are 2 .exe file in user's PC with the same name "SMS_1" then which .exe file would be run ? 2) the parameter @WorkingDir could be any path i want , am i right ? thanks Link to comment Share on other sites More sharing options...
Nahuel Posted August 9, 2008 Share Posted August 9, 2008 No. The working dir is something different. There can't be two files with the same name in the same directory. The .exe's path is taken from the first parameter. Run("notepad.exe", @WorkingDir) Run("notepad.exe", "C:\") I'm guessing this gives you 2 notepads. Link to comment Share on other sites More sharing options...
BigDog Posted August 9, 2008 Author Share Posted August 9, 2008 No. The working dir is something different. There can't be two files with the same name in the same directory. The .exe's path is taken from the first parameter. Run("notepad.exe", @WorkingDir) Run("notepad.exe", "C:\") I'm guessing this gives you 2 notepads.thank you , and why when we Run("notepad.exe", $somepath) not need indicate the full path of notepad.exe ? Link to comment Share on other sites More sharing options...
ChrisL Posted August 9, 2008 Share Posted August 9, 2008 (edited) thank you , andwhy when we Run("notepad.exe", $somepath) not need indicate the full path of notepad.exe ?Because Notepad is in the Windows Directory, if you had a notepad on d: which was something eles you'd have to specify d:\Notepad.exe but if you just used Notepad.exe then the one in the windows directory would run.You could run both and have both of them using hte same Working Directory but they would have different run paths Run("D:\Notepad.exe",$somepath) and Run ("Notepad.exe",$SomePath) Edited August 9, 2008 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
BigDog Posted August 9, 2008 Author Share Posted August 9, 2008 Because Notepad is in the Windows Directory, if you had a notepad on d: which was something eles you'd have to specify d:\Notepad.exe but if you just used Notepad.exe then the one in the windows directory would run.You could run both and have both of them using hte same Working Directory but they would have different run paths Run("D:\Notepad.exe",$somepath) and Run ("Notepad.exe",$SomePath)thank you , andcould we put my .exe file to the Windows Directory ?where it is ?any other steps i need to know ? Link to comment Share on other sites More sharing options...
womue Posted August 9, 2008 Share Posted August 9, 2008 (edited) thank you , andcould we put my .exe file to the Windows Directory ?where it is ?any other steps i need to know ?BigDog,notepad is not starting without the full path because of being in the windws directory(though ist is)it is starting because it is in you PATH.So if you PATH environment variable is C:\DIR1;C:\WINDOWSand C:\DIR1 contains a NOTEPAD.exe, it is this one which will be started, until it is deleted or the PATHvar is changed. Edited August 9, 2008 by womue Link to comment Share on other sites More sharing options...
ChrisL Posted August 9, 2008 Share Posted August 9, 2008 thank you , andcould we put my .exe file to the Windows Directory ?where it is ?any other steps i need to know ?Yeah you can put your file in the windows directory if you want but if you have 2 files with the same name then you'll have to have them in 2 different locations/directories or make sure they have different names.I personally wouldn't put my exe's in the Windows directory I would specify the full path to my files in my folder elsewhere [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
ChrisL Posted August 9, 2008 Share Posted August 9, 2008 BigDog,notepad is not starting without the full path because of being in the windws directory(though ist is)it is starting because it is in you PATH.So if you PATH environment variable is C:\DIR1;C:\WINDOWSand C:\DIR1 contains a NOTEPAD.exe, it is this one which will be started, until it is deleted or the PATHvar is changed.Go Start\Run\Notepad and Notepad would runTry doing that with a file somewhere else in a folder on your desktop and it wont find it$somepath has nothing to do with running the file it is only the directory to use as a working directory. You could run a file from D:\Myfile.exe and set the working path to C:\Windows then any resourses that were specified in the program which used relevant paths would be loaded from the working directory of C:\WindowsHowever you can specify new Application paths in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire 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