eightyhd Posted June 18, 2005 Share Posted June 18, 2005 heys guys!just want to know how to delete the C:\Install folder?I want to create a batch file after install, underC:\install\wpi\DELETEDIR.BAT1. What is the command for the batch2. Does it go under [GUI RUNONCE] ? Link to comment Share on other sites More sharing options...
Synapse Posted June 18, 2005 Share Posted June 18, 2005 what command you are looking for is:RD /S /Q %systemdrive%\installthat meansRD - Remove Directory/S - Removes all directories and files in the specified directory/Q - Quiet mode, do not ask if ok to remove a directory with /S Link to comment Share on other sites More sharing options...
Benzal Posted June 26, 2005 Share Posted June 26, 2005 I've tried that and for some reason, once everything is done, I'm still left with C:\Install\WPIthe WPI folder is empty but I'd like the whole directories to be deleted...I call my batch straight form WPI.cmd at the end... Link to comment Share on other sites More sharing options...
glent Posted June 26, 2005 Share Posted June 26, 2005 maybe wpi is still in use and therefore can not be deleted ? Link to comment Share on other sites More sharing options...
Benzal Posted June 26, 2005 Share Posted June 26, 2005 I thought that and I did try and launch the deleting procedure from the same script that deletes the installation drivers but that didn't workeither...Here are the details:CMDOW @ /HID RD /S /Q %SystemDrive%\D CMDOW @ /HID RD /S /Q %SystemDrive%\Installthat should have done it but it didnt... Link to comment Share on other sites More sharing options...
Benzal Posted June 26, 2005 Share Posted June 26, 2005 this is my winnt.sif file:command2 = "%systemdrive%\install\wpi\wpi.cmd"command3 = "%SystemDrive%\D\BTS_DPs_finish.cmd" Link to comment Share on other sites More sharing options...
BoardBabe Posted June 26, 2005 Share Posted June 26, 2005 I run all my cleanup from wpi.cmd, works like a charmI also delete wpi.cmd from the very last line of wpi.cmd Link to comment Share on other sites More sharing options...
Benzal Posted June 26, 2005 Share Posted June 26, 2005 what commands do you use??? Link to comment Share on other sites More sharing options...
BoardBabe Posted June 26, 2005 Share Posted June 26, 2005 (edited) Here is my entire (slightly modified for posting) wpi.cmd (renamed to Start.cmd). It is placed in $OEM$\$1 and Launched from winnt.sif.Start.cmdcmdow @ /HID@ECHO OFFTITLE Welcome to Microsoft Windows XPrem Determin path to CDROM.for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\WIN51 set CDROM=%%i:rem Determin path for WPI.set WPIPATH=%CDROM%\WPIrem Changing screen resolution.start %wpipath%\common\VideoChanger.exe 1400x1050x32@60 -qrem Installing WPI font.start /wait %wpipath%\common\fonts\fontinstaller.exerem Implementing WPI regtweak.regedit /s "%wpipath%\common\wpi.reg"rem Changing current path to WPI path.for /f "delims=: tokens=1" %%i in ("%wpipath%") do %%i:cd "%wpipath%"rem Creating temp install folder on systemdrive.mkdir %SystemDrive%\Installrem Start WPI and wait for it to complete.start /wait WPI.htarem Begin final cleanup and configuration.rem Register Windows Update V6.regsvr32 /s %WinDir%\system32\wups2.dllrem Change volumename on systemdisk.label %SystemDrive% Systemrem Change user picture.copy /y "%AllUsersProfile%\Programdata\Microsoft\User Account Pictures\Default Pictures\strand.bmp" "%AllUsersProfile%\Programdata\Microsoft\User Account Pictures\%UserName%.bmp"rem Deactivate automatic logon.reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoAdminLogon" /d "0" /frem Delete .NET user account.net user aspnet /deleterem Sync local time with online time server.net time /sETSNTP:ntp.uio.nocall %WinDir%\System32\w32tm.exe /resyncrem Start cleanup of application specific shortcuts from start menurem Delete shortcuts to Realtek Sound Manager.if exist "%AllUsersProfile%\Start-meny\Programmer\Realtek Sound Manager" rd /s /q "%AllUsersProfile%\Start-meny\Programmer\Realtek Sound Manager"(...)rem Delete all shortcuts from desktop.del /s /q "%UserProfile%\Skrivebord\*.lnk"del /s /q "%AllUsersProfile%\Skrivebord\*.lnk"rem Delete all applications from Startup folder.del /s /q "%UserProfile%\Start-meny\Programmer\Oppstart\*.lnk"del /s /q "%AllUsersProfile%\Start-meny\Programmer\Oppstart\*.lnk"rem Delete temp files.for /d %%g in ("%temp%\*") do rd /s /q "%%g"for %%g in ("%temp%\*") do del /s /q "%%g"for /d %%g in ("%windir%\Downloaded Installations\*") do rd /s /q "%%g"for %%g in ("%windir%\Downloaded Installations\*") do del /s /q "%%g"rd /s /q %SystemDrive%\Installrd /s /q %SystemDrive%\Drivererem Restart Windows.shutdown.exe -r -f -t 60 -c "Vennligst vent..."rem Delete Start.cmd.del /s /q %SystemDrive%\Start.cmdexit:endNote that paths are for Norwegian Win XP, and that I quickly translated the comments to english so you understand what is going on at the different lines.Skrivebord=DekstopStart-meny=Start MenuProgrammer=ProgramsOppstart=StarupHope this helps... Edited June 26, 2005 by BoardBabe Link to comment Share on other sites More sharing options...
Benzal Posted June 30, 2005 Share Posted June 30, 2005 So, in your scripyt the actual command that gets rid of the C:\install folder is this:rd /s /q %SystemDrive%\Installlike for my install...So, why does yours work and not mine??? Link to comment Share on other sites More sharing options...
Benzal Posted June 30, 2005 Share Posted June 30, 2005 should I maybe put all this:for /d %%g in ("%temp%\*") do rd /s /q "%%g"for %%g in ("%temp%\*") do del /s /q "%%g"for /d %%g in ("%windir%\Downloaded Installations\*") do rd /s /q "%%g"for %%g in ("%windir%\Downloaded Installations\*") do del /s /q "%%g" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now