Hello.
I am having some difficulty with my batch file.
I am trying to make 1 batch file work on english and every other language out there, without having to have a billion lines for each and every language location.
This is my first foray into batch files, and I know absolutely 0 code, in any language.
I have searched and found a lot on what I am trying to, and I have this so far:
Quote:
REM Check Windows Version
ver | findstr /i "5\.1\." > nul
IF %ERRORLEVEL% EQU 0 goto ver_XP
ver | findstr /i "6\.0\." > nul
IF %ERRORLEVEL% EQU 0 goto ver_Vista
ver | findstr /i "6\.1\." > nul
IF %ERRORLEVEL% EQU 0 goto ver_Win7
goto warn_and_exit
:ver_Win7
rd /s /q "%USERPROFILE%\my documents\norton"
rd /s /q "%APPDATA%\documents\norton"
rd /s /q "%ALLUSERSPROFILE%\Documents\norton"
rd /s /q "%PROGRAMDATA%\Norton"
rd /s /q "%PUBLIC%\Downloads\Norton"
rd /s /q "%PROGRAMDATA%\NortonInstaller"
del /q "%USERPROFILE%\Desktop\*.lnk"
del /q "%USERPROFILE%\Desktop\*.exe"
rd /s /q "%APPDATA%\nortoninstaller"
rd /s /q "%HOMEPATH%\Start Menu\Programs\norton"
rd /s /q "%APPDATA%\microsoft\windows\start menu\norton"
rd /s /q "%HOMEPATH%\Local Settings\Temporary Internet Files"
del /q /f "%HOMEPATH%\Local Settings\Temp\*.*"
reg delete HKCU\Software\Microsoft\Windows\CurrentVersion\Run /va /f
reg delete HKCU\Software\norton /f
reg delete HKLM\Software\norton /f
reg delete HKLM\Software\symantec /f
reg delete HKCU\Software\wow6432node\norton /f
reg delete HKLM\Software\wow6432node\norton /f
reg delete HKLM\Software\wow6432node\symantec /f
REM echo OS Version: Windows XP (debug line)
goto end
REM echo OS Version: Windows 7 (debug line)
goto end
:ver_Vista
rd /s /q "%USERPROFILE%\my documents\norton"
rd /s /q "%APPDATA%\documents\norton"
rd /s /q "%ALLUSERSPROFILE%\Documents\norton"
rd /s /q "%PROGRAMDATA%\Norton"
rd /s /q "%PUBLIC%\Downloads\Norton"
rd /s /q "%PROGRAMDATA%\NortonInstaller"
del /q "%USERPROFILE%\Desktop\*.lnk"
del /q "%USERPROFILE%\Desktop\*.exe"
rd /s /q "%APPDATA%\nortoninstaller"
rd /s /q "%HOMEPATH%\Start Menu\Programs\norton"
rd /s /q "%HOMEPATH%\Local Settings\Temporary Internet Files"
del /q /f "%HOMEPATH%\Local Settings\Temp\*.*"
reg delete HKCU\Software\Microsoft\Windows\CurrentVersion\Run /va /f
reg delete HKCU\Software\norton /f
reg delete HKLM\Software\norton /f
reg delete HKLM\Software\symantec /f
reg delete HKCU\Software\wow6432node\norton /f
reg delete HKLM\Software\wow6432node\norton /f
reg delete HKLM\Software\wow6432node\symantec /f
REM echo OS Version: Windows Vista (debug line)
goto end
:ver_XP
rd /s /q "%USERPROFILE%\my documents\norton"
rd /s /q "%APPDATA%\documents\norton"
rd /s /q "%ALLUSERSPROFILE%\Documents\norton"
rd /s /q "%ALLUSERSPROFILE%\Application Data\Norton"
rd /s /q "%ALLUSERSPROFILE%\Application Data\NortonInstaller"
del /q "%USERPROFILE%\Desktop\*.lnk"
del /q "%USERPROFILE%\Desktop\*.exe"
rd /s /q "%APPDATA%\nortoninstaller"
rd /s /q "%HOMEPATH%\Start Menu\Programs\norton"
rd /s /q "%HOMEPATH%\Local Settings\Temporary Internet Files"
del /q /f "%HOMEPATH%\Local Settings\Temp\*.*"
reg delete HKCU\Software\Microsoft\Windows\CurrentVersion\Run /va /f
reg delete HKCU\Software\norton /f
reg delete HKLM\Software\norton /f
reg delete HKLM\Software\symantec /f
REM echo OS Version: Windows XP (debug line)
goto end
:warn_and_exit
echo Machine OS cannot be determined.
:end
|
This works fairly well on english (the temp dir wont delete directories).
Everything else works great though.
Except, I cant get the desktop shortcuts and the start menu shortcuts to delete on languages other than english.
Any help would be appreciated.
Dave