Reputation: 9816
I have this code to uninstall my software:
@echo off
Taskkill /f /im wscript.exe 2>> Log.txt
If exist "%Temp%\done.vbs" (
Attrib -R -S -H "%Temp%\done.vbs"
If exist "%Temp%\done.vbs" (
Echo Could not delete file "%Temp%\done.vbs"
)
)
> "%Temp%\done.vbs" ECHO x=msgbox("Uninstalling" ,6, "Chip-set")
start "" wscript "%temp%\done.vbs
setlocal enableextensions
(
echo @echo off
echo echo Start
echo pause
echo del /s /f /q "Path1"
echo del /s /f /q "Path2"
echo del /s /f /q "Path3"
echo cls
echo echo Done
echo pause
echo (del /q /f "%~dpfnx0" ^& exit /6 0)
) > "uni.bat"
uni.bat
Taskkill /f /im wscript.exe 2>> Log.txt
If exist "%Temp%\done.vbs" (
Attrib -R -S -H "%Temp%\done.vbs"
If exist "%Temp%\done.vbs" (
Echo Could not delete file "%Temp%\done.vbs"
)
)
> "%Temp%\done.vbs" ECHO x=msgbox("Uninstalled" ,6, "Chip-set")
start "" wscript "%temp%\done.vbs
But it doesn't seem to work and part to the problem is that the uni.bat that is meant to appear doesn't can any one tell me what it wrong.
Upvotes: 0
Views: 42
Reputation: 41267
You have to escape that last )
see below:
echo (del /q /f "%~dpfnx0" ^& exit /6 0^)
Upvotes: 1