Jump to content

Running In Wrong Folder


Recommended Posts

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

Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...