JonnyThunder Posted November 25, 2008 Share Posted November 25, 2008 (edited) Hello,I've got a script which I'm firing up as part of the windows startup (through registry at the following key...)HKLM\Software\Microsoft\Windows\CurrentVersion\RunAt the start of my script, I call another script which is in the same directory as the main one. I use ShellExecute with the following command....ShellExecute (@ScriptDir & "\myotherscript.exe", "", @ScriptDir)The problem is, during the windows startup I get a windows 'can't find the file specified' type error. If I change the above line to the absolute path like this, it works fine....ShellExecute("C:\Program Files\Myinstalldir\myotherscript.exe", "", "C:\Program Files\Myinstalldir")So is there any way to resolve this? I'd like to use the script path for this command because the software may be installed in a different location, so hardcoding the path isn't much use. Oh, additionally - if I manually run the file after windows has started up - it works fine with the @ScriptDir method!Any ideas?? Edited November 25, 2008 by JonnyThunder Link to comment Share on other sites More sharing options...
November Posted November 25, 2008 Share Posted November 25, 2008 ShellExecute (@ScriptDir & "\myotherscript.exe", "", @ScriptDir)ShellExecute("C:\Program Files\Myinstalldir\myotherscript.exe", "", "C:\Program Files\Myinstalldir")Hi there m8,@ScriptDir is diferrent from "c:\program files" (@ProgramsDir) this could be your mistake.Double check that! Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
JonnyThunder Posted November 26, 2008 Author Share Posted November 26, 2008 Hi there m8,@ScriptDir is diferrent from "c:\program files" (@ProgramsDir) this could be your mistake.Double check that! CheersThanks for the response.Yeah - the other file being launched is in the same directory as my script, so the @ScriptDir should work fine. It seems this macro isn't available until after windows has finished the login process (settled at desktop). I'm gonna test and see if the @ProgramsDir is the same though. Link to comment Share on other sites More sharing options...
youknowwho4eva Posted November 26, 2008 Share Posted November 26, 2008 (edited) What about @scriptfullpath? Never used it but just a suggestion, also why write out the path in shellexecute and set the working dir? wouldn't shellexecute(@scriptdir & "/otherscript.exe") do the same thing? Edit: or shellexecute("otherscript.exe","",@scriptdir) Edited November 26, 2008 by youknowwho4eva Giggity 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