Run file batch after use FileWrite is error
I have one prolem which I can not explain why it does not work.
I want to run a file batch on "E:\TEST\TEST.BAT"
I also look for on forum and wiki about it.And I do it the same way which they help but I still not work.
My code here:
ReadRegStr $Temp1 HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\TEST" \
"UninstallString"
StrCmp $Temp1 "" 0 done
done: ;E:\TEST\uninst.exe
Push $Temp1
Call GetParent
Pop $Temp1 ;E:\TEST
GetTempFileName $0
StrCpy $0 "temp.bat"
FileOpen $1 $0 "W"
FileWrite $1 "@echo off$\r$\n"
StrCpy $2 $Temp1 2 ;E:
FileWrite $1 "$2$\r$\n"
FileWrite $1 "cd test$\r$\n"
FileWrite $1 "test.bat$\r$\n"
FileWrite $1 "pause"
FileClose $1
Exec '$0'
When I execute it, it display on console window with one line which is repeated many times
The system can not find the path specified
I also look on file temp.bat has content :
@echo offSomeone used to work with filewrite,please tell me!If my words is so bad, please tell me! Thank a lot.
E:
cd test
test.bat
pause
Your help is very useful for me!