Sign in to follow this  
Followers 0
JonnyThunder

Macros not available on startup

4 posts in this topic

#1 ·  Posted (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\Run

At 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 by JonnyThunder

Share this post


Link to post
Share on other sites



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]

Share this post


Link to post
Share on other sites

Hi there m8,

@ScriptDir is diferrent from "c:\program files" (@ProgramsDir) this could be your mistake.

Double check that! :)

Cheers

Thanks 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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by youknowwho4eva

Giggity

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0