Jump to content

Force Delete of Install Folder


Recommended Posts

During my cleanup phase of my setup I have this last command:

RD /S /Q "%systemdrive%\install\"

Everything inside this folder get deleted properly EXCEPT for one file named Lancement.exe. I beleive it is not deleted because Windows think it is still in use.

Is there a way to Force Delete this directory?

EDIT: or maybe a way to force delete the file %systemdrive%\install\Lancement.exe

Link to comment
Share on other sites


Odd... my install folder is still there :blink: even if it is empty now (I used kill.exe for Win2000 to terminate the Lancement.exe process)

If I restart my cleanup.cmd again (2nd time) now it will be deleted

Here is my cleanup.cmd:

RD /S /Q "%AllUsersProfile%\Menu D‚marrer\Programmes\DivX"

DEL "%UserProfile%\Application Data\Microsoft\Internet Explorer\Quick Launch\Ad-Aware SE Personal.lnk"
DEL "%UserProfile%\Bureau\Connexion … Internet.lnk"
DEL "%AllUsersProfile%\Menu D‚marrer\Programmes\D,marrage\Lancement rapide d'Adobe Reader.lnk"
DEL "%AllUsersProfile%\Bureau\Adobe Reader 7.0.lnk"
DEL "%AllUsersProfile%\Bureau\DivX Movies.lnk"
DEL "%AllUsersProfile%\Bureau\DivX Player.lnk"

DEL "%windir%\PnPdrvrs.exe"

RD /S /Q "%windir%\PnPdrvrs\"
RD /S /Q "%systemdrive%\í\"
RD /S /Q "%systemdrive%\Intel\"
RD /S /Q "%systemdrive%\install"

Link to comment
Share on other sites

Thank you guys.

Just to keep you informed, here is the latest developpement.

I've been using kill.exe (same as taskkill but for Win2000) to remove Lancement.exe from the active process. This was a BAD idea. Since it was launched from GuiRunOnce in my winnt.sif, as soon as I killed this process, the desktop would load while my RunOnceEx was running... I also had another mixed issue with Adobe Reader 7 (read HERE)

Then I tought it was because I converted my .cmd to .exe I wasn't able to delete my Install folder. It turns out that even with batch files the same will happen.

From my understanding, if you are launching a batch file from %systemdrive%\Install\ the stuff is executed by Windows at that location. This is why I can't delete my Install folder properly. My Workaround for this is that I have changed the location of my Install folder. From now on, it is located inside %windir%\Temp\ so I don't mind if it stay there...

Here is my event timeline:

1) GuiRunOnce is launching Lancement.exe in my %windir%\Temp\ folder

2) Lancement.exe (.cmd converted) is scanning for the %CDROM% and then launching Installation.exe

3) Installation.exe (my RunOnceEx.cmd converted) is starting my applications installation

4) Installation.exe is launching Nettoyage.exe (cleanup.cmd converted) also located on my %CDROM%

Keep in mind that Windows is executing all theses .exe in my %windir%\Temp\Install so this is why I am not able to delete properly...

Link to comment
Share on other sites

i just run my cleanup following a reboot.

(after all programs install, i add cleanup to runonceex, and use psshutdown to reboot. then, the next loadup deletes all the folders/files/shortcuts. no problems this way)

Link to comment
Share on other sites

Here A Vbs Code That deletes It Self

RED Means You Can Change

ORANGE Means You Can KEEP OR REMOVE LINE

Dim Garbage

set Garbage = (CreateObject("Scripting.FileSystemObject"))

msgbox "Starting Clean UP?",vbokonly+48,"Clean Up"

Garbage.DeleteFile ("\CU1.vbs")

wscript.sleep 500

Delete=("\CU1.vbs")

wscript.sleep 500

msgbox "Clean UP Completed?",vbokonly+48,"Clean Up Those Files"

Here A Cmd That Produces The Same Vbs

But It Wont Delete The Cmd. Use This To Make As Many Needed.

echo off

cls

color f2

mode con: cols=55 Lines=3

Title Test Remove Vbs

> %Systemdrive%\CU1.vbs echo Dim Garbage

>> %Systemdrive%\CU1.vbs echo set Garbage = (CreateObject("Scripting.FileSystemObject"))

>> %Systemdrive%\CU1.vbs echo msgbox "Starting Clean UP?",vbokonly+48,"Clean Up"

>> %Systemdrive%\CU1.vbs echo Garbage.DeleteFile  ("\CU1.vbs")

>> %Systemdrive%\CU1.vbs echo wscript.sleep 500

>> %Systemdrive%\CU1.vbs echo Delete= ("\CU1.vbs")

>> %Systemdrive%\CU1.vbs echo wscript.sleep 500

>> %Systemdrive%\CU1.vbs echo msgbox "Clean UP Completed?",vbokonly+48,"Clean Up Those Files"

start /w %Systemdrive%\CU1.vbs

set /p = Press Key To Close

The Above Are From My Clean Up Template I Just Change

some Of the Names And Took Out The Test And Short Cut Sections.

Edited by gunsmokingman
Link to comment
Share on other sites

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