Sign in to follow this  
Followers 0
onestcoder

Running In Wrong Folder

3 posts in this topic

I'm trying to get my script to run a program from the folder it's located in.

I'm using

Func Windower2()
    Run(@ProgramFilesDir & "\Onestcoder\Tools\FFWindower\FFHookLauncher.exe")
EndFunc

My script is located in

@ProgramFilesDir & "\Onestcoder\

So ever time I call Windower2() its run in the

@ProgramFilesDir & "\Onestcoder\

Instead of

@ProgramFilesDir & "\Onestcoder\Tools\FFWindower\

???


Need a website: http://www.iconixmarketing.com

Share this post


Link to post
Share on other sites



I figure it has somthing to do with

@WorkingDir

But help file isn't real clear of how to use it.. To me


Need a website: http://www.iconixmarketing.com

Share this post


Link to post
Share on other sites

Add the working directory to the Run function.

Func Windower2()
    $directory = @ProgramFilesDir & "\Onestcoder\Tools\FFWindower"
    Run($directory & "\FFHookLauncher.exe", $directory)
EndFunc

Or perhaps change the working directory for additional code usage

Func Windower2()
    If FileChangeDir(@ProgramFilesDir & "\Onestcoder\Tools\FFWindower") Then
        Run("FFHookLauncher.exe")
    Else
        MsgBox(0x10, @ScriptName, 'WorkingDir ' & @WorkingDir & ' is incorrect')
    EndIf
EndFunc

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