Jump to content
Sign in to follow this  
onestcoder

Running In Wrong Folder

Recommended Posts

onestcoder

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
onestcoder

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
MHz

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.