Jump to content

Recommended Posts

I made a program where you enter a filename and enter a path to the file and it stores it in a .dat file. Then the button to run it reads the lines in the .dat file and assigns the filename to a variable and the path to a variable then gets the run command to run it, looks like this:

Func ShortC()
    $Path = Inputbox( "File Path", "Please enter path of file" , "Path" , "" , -1, 75, -1,-1 )
    FileWriteLine("ShortCut.dat", $Path)
    $File = Inputbox( "File", "Please enter filename" , "File" , "" , -1, 75, -1,-1 )
    FileWriteLine("ShortCut.dat", $File)
EndFunc
        
Func F6()
    $Path = FileReadLine("ShortCut.dat", 1)
    $File = FileReadLine("ShortCut.dat", 2)
    Run($File, $Path, @SW_MAXIMIZE) 
EndFunc

The run command doesn't like to to read the variables, what can i do??

Link to comment
Share on other sites

You should really verify to make sure the data is a valid path. Also, the run command will only launch executable file types. If the files are not of .exe (Or .bat) type, you'll have to start it through a command line such as:

Run(@ComSpec & " /c " & $File, $Path, $SW_HIDE)

SW_HIDE hides the DOS window.

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