boltc Posted September 27, 2005 Share Posted September 27, 2005 (edited) srry for my very bad englishi want to run a file for another dir.. how can i do this?the file is located to data\eph.regi did this before, Run("C:\Documents and Settings\Nieuwe bo\Mijn documenten\my program\data\eph.reg", "")(the exe file(that you need to run) is located toC:\Documents and Settings\Nieuwe bo\Mijn documenten\my program\but if someone else download my program and exact it to somewhere else, it doesnt work....i tried thiks like this but doesnt work:Run("data\eph.reg", "")Run("eph.reg", "data")the readme says this:Run ( "filename" [, "workingdir" [, flag]] )Parametersfilename The full name of the executable (EXE, BAT, COM, or PIF) to run. workingdir [optional] The working directory. flag [optional] The "show" flag of the executed program: @SW_HIDE = Hidden window @SW_MINIMIZE = Minimized window @SW_MAXIMIZE = Maximized windowsomeone know how to fix this problem? Edited September 27, 2005 by boltc Link to comment Share on other sites More sharing options...
GaryFrost Posted September 27, 2005 Share Posted September 27, 2005 might want to try something like Run(@ScriptDir & "\eph.reg") SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
boltc Posted September 27, 2005 Author Share Posted September 27, 2005 might want to try something likeRun(@ScriptDir & "\eph.reg")nope, dont work Link to comment Share on other sites More sharing options...
LxP Posted September 27, 2005 Share Posted September 27, 2005 I believe that Gary meant this: run(@scriptDir & "\data\eph.reg") Link to comment Share on other sites More sharing options...
boltc Posted September 27, 2005 Author Share Posted September 27, 2005 (edited) I believe that Gary meant this:run(@scriptDir & "\data\eph.reg")nope, same error Edited September 27, 2005 by boltc Link to comment Share on other sites More sharing options...
LxP Posted September 27, 2005 Share Posted September 27, 2005 If script.exe is located in C:\folder, eph.reg is located in C:\folder\data and script.exe wants to run eph.reg, then script.exe must call: run(@scriptDir & "\data\eph.reg") If this is not what you are asking, please explain further. Link to comment Share on other sites More sharing options...
BigDod Posted September 27, 2005 Share Posted September 27, 2005 nope, same errorIf you use fileinstall to include eph.reg then you will know exactly where the file is and @scriptDir will work. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
boltc Posted September 27, 2005 Author Share Posted September 27, 2005 (edited) If script.exe is located in C:\folder, eph.reg is located in C:\folder\data and script.exe wants to run eph.reg, then script.exe must call:run(@scriptDir & "\data\eph.reg")If this is not what you are asking, please explain further.that is exactly what i mean, but it still dont work..maybe do i need to add somethink like this on the top of the script?#include <GuiConstants.au3>---------------------------------------------------------------------If you use fileinstall to include eph.reg then you will know exactly where the file is and @scriptDir will work.how to include it when it is in the data dir? Edited September 27, 2005 by boltc Link to comment Share on other sites More sharing options...
LxP Posted September 27, 2005 Share Posted September 27, 2005 Try adding this line to your script: local $file = @scriptDir & "\data\eph.reg" msgBox(0x40, $file, fileExists($file)) It will display a message box containing the full path to eph.reg and a number, where 1 means that the file exists and 0 means that it doesn't. If the box reports 0 then you will need to modify $file until it reports 1.If the box reports 1 already then it is another issue. Link to comment Share on other sites More sharing options...
GaryFrost Posted September 27, 2005 Share Posted September 27, 2005 Might also be a permission issue on the other pc's, just a thought. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Valik Posted September 27, 2005 Share Posted September 27, 2005 The last time I checked, *.reg files were not executable files but rather they invoked an executable to run them. Link to comment Share on other sites More sharing options...
LxP Posted September 27, 2005 Share Posted September 27, 2005 Oops, good point. Feeling like an ass. It's easy (when not testing) to forget that the Run() and RunWait() commands only work with executables. Try this: $file = @scriptDir & "\data\eph.reg" run(@comSpec & ' /c start "" "' & $file & '"', "", @SW_HIDE) If you want the script to pause until the process completes, try this: $file = @scriptDir & "\data\eph.reg" runWait(@comSpec & ' /c start "" /wait "' & $file & '"', "", @SW_HIDE) Link to comment Share on other sites More sharing options...
boltc Posted September 27, 2005 Author Share Posted September 27, 2005 (edited) by LxP$file = @scriptDir & "\data\eph.reg" run(@comSpec & ' /c start "" "' & $file & '"', "", @SW_HIDE)thanks.. it works Edited October 3, 2005 by boltc 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