Jump to content

Delete install folder after unattended install


Recommended Posts


I'm back :-))

I have 2 folders i will delete

install and drivers

If i use this:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]

"Cleanup"="cmd /C RD %systemdrive%\\install /S /Q"

"Cleanup"="cmd /C RD %systemdrive%\\drivers /S /Q"

the install folder is still there after reboot and drivers is gone

If I use this:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]

"Cleanup"="cmd /C RD %systemdrive%\\install /S /Q"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]

"Cleanup"="cmd /C RD %systemdrive%\\drivers /S /Q"

the same

the install folder is still there after reboot and drivers is gone

if i use this

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]

"Cleanup"="cmd /C RD %systemdrive%\\install /S /Q"

install is gone

How do I delete 2 folders????

Link to comment
Share on other sites

This one's easy :) The point is, you're adding a value called Cleanup to the registry. What you're doing is first adding the value Cleanup, with the contens "cmd /C RD %systemdrive%\\install /S /Q". After that, you're adding the same value again (thus overwriting the previous value) with some other contents. I think I'm explaining it a bit too difficult, but here's what you gotta do:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"Cleanup1"="cmd /C RD %systemdrive%\\install /S /Q"
"Cleanup2"="cmd /C RD %systemdrive%\\drivers /S /Q"

Now, first the command of Cleanup1 will be executed, and after that the command of Cleanup2. If you want to add more vaules, just name them Cleanup3, Cleanup4, etc.

Hope you got it all sorted out now :)

Link to comment
Share on other sites

Add this to a reg file:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"Cleanup"="cmd.exe /C RD %systemdrive%\install /S /Q"

And then make sure you import it to the registry somewhere. You can also use this code from a batch file:

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /V Cleanup /D "cmd.exe /C RD %systemdrive%\install /S /Q"

I believe that should work :)

is the ADD REG code still good or does it also have to have 2 \'s?

Link to comment
Share on other sites

Add this to a reg file:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"Cleanup"="cmd.exe /C RD %systemdrive%\install /S /Q"

And then make sure you import it to the registry somewhere. You can also use this code from a batch file:

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /V Cleanup /D "cmd.exe /C RD %systemdrive%\install /S /Q"

I believe that should work :)

is the ADD REG code still good or does it also have to have 2 \'s?

It also needs the two slashes:

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /V Cleanup /D "cmd.exe /C RD %systemdrive%\\install /S /Q"

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