Archive: FileOpen


FileOpen
I want to open a programm in c:\test.bat

the help gave me this example:

FileOpen $0 $INSTDIR\file.dat r
FileClose $0


so I made a attempt

FileOpen $0 $c\test.bat r
File Close $0

but it does not work ....why ?



Section
FileOpen $0 "c:\test.bat" r
IfErrors 0 +3
MessageBox MB_OK "Error fopen"
Abort

FileClose $0
SectionEnd

Error if file not exists only. Or may be you want to execute file?

I just want to start the test.bat
but it does not work

your code does not work, too...


FileOpen file r
opens file for read :)
To run bat file use nsExec plug-in from Program Files\NSIS\Contrib\nsExec folder (sample included). Forum search may help with other samples. http://forums.winamp.com/showthread....hreadid=181442 thread, Anders' post - echo off & cls commands to be sure that hidden bat window will really close.


it does not work...


What does not work?
Have you tried
nsExec::Exec "c:\test.bat"
You should not that nsExec will hide the command-prompt window so you may not realise that it was executed at all!

-Stu