Jump to content



Photo

Run


  • Please log in to reply
1 reply to this topic

#1 CyberFunk Productions

CyberFunk Productions

    Wayfarer

  • Active Members
  • Pip
  • 68 posts

Posted 19 March 2004 - 10:19 PM

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





#2 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 19 March 2004 - 10:28 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users