Jump to content

Recommended Posts

Posted

heys guys!

just want to know how to delete the C:\Install folder?

I want to create a batch file after install, under

C:\install\wpi\DELETEDIR.BAT

1. What is the command for the batch

2. Does it go under [GUI RUNONCE] ?


Posted

what command you are looking for is:

RD /S /Q %systemdrive%\install

that means

RD - 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

  • 2 weeks later...
Posted

I've tried that and for some reason, once everything is done, I'm still left with C:\Install\WPI

the 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...

Posted

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 work

either...

Here are the details:

CMDOW @ /HID

RD /S /Q %SystemDrive%\D

CMDOW @ /HID

RD /S /Q %SystemDrive%\Install

that should have done it but it didnt...

Posted

this is my winnt.sif file:

command2 = "%systemdrive%\install\wpi\wpi.cmd"

command3 = "%SystemDrive%\D\BTS_DPs_finish.cmd"

Posted (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.cmd

cmdow @ /HID
@ECHO OFF

TITLE Welcome to Microsoft Windows XP

rem 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%\WPI

rem Changing screen resolution.
start %wpipath%\common\VideoChanger.exe 1400x1050x32@60 -q

rem Installing WPI font.
start /wait %wpipath%\common\fonts\fontinstaller.exe

rem 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%\Install

rem Start WPI and wait for it to complete.
start /wait WPI.hta

rem Begin final cleanup and configuration.

rem Register Windows Update V6.
regsvr32 /s %WinDir%\system32\wups2.dll

rem Change volumename on systemdisk.
label %SystemDrive% System

rem 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" /f

rem Delete .NET user account.
net user aspnet /delete

rem Sync local time with online time server.
net time /sETSNTP:ntp.uio.no
call %WinDir%\System32\w32tm.exe /resync

rem Start cleanup of application specific shortcuts from start menu

rem 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%\Install
rd /s /q %SystemDrive%\Drivere

rem Restart Windows.
shutdown.exe -r -f -t 60 -c "Vennligst vent..."

rem Delete Start.cmd.
del /s /q %SystemDrive%\Start.cmd

exit

:end

Note 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=Dekstop

Start-meny=Start Menu

Programmer=Programs

Oppstart=Starup

Hope this helps...

Edited by BoardBabe
Posted

So, in your scripyt the actual command that gets rid of the C:\install folder is this:

rd /s /q %SystemDrive%\Install

like for my install...

So, why does yours work and not mine???

Posted

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"

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...