Forum Archive

Go Back   3D Realms Forums > General Topics > Programming Forum
Blogs FAQ Community Calendar

Notices

 
 
Thread Tools
Old 10-02-2010, 11:17 AM   #1
nebiatsu
Batch file help ....
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
nebiatsu is offline  
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 06:41 AM.

Page generated in 0.10911012 seconds (100.00% PHP - 0% MySQL) with 16 queries

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

Website is ©1987-2014 Apogee Software, Ltd.
Ideas and messages posted here become property of Apogee Software Ltd.