i checked my file with
MsgBox($MB_SYSTEMMODAL, "", "Contents of the file:" & @CRLF & $sFileRead)
so i know i created the file successfully
but when i want to change it to .bat
by moving it into a junk .bat
file (other people probably have a better way of doing it) i get an error.
$CMD = "move "$sFilePath" " & $jointpath & @CRLF
RunWait(@ComSpec & " /c " & $CMD)
i get
error: syntax error
here is the whole function:
Func makeJointBat()
Local Const $sFilePath = _WinAPI_GetTempFileName(@TempDir)
FileWrite($sFilePath, "you don't need to know what i wrote there")
Local $hFileOpen = FileOpen($sFilePath, $FO_READ)
Local $sFileRead = FileRead($hFileOpen)
FileClose($hFileOpen)
$CMD = "move "$sFilePath" " & $jointpath & @CRLF
RunWait(@ComSpec & " /c " & $CMD)
EndFunc ;==>makeJointBat
The problem might be that you seem to be opening the file two times: Once when creating it, then again when reading it.
However, you are only closing it once.
Adding a FileClose
between the FileWrite
and the FileOpen
might help with the problem.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments