Jump to content

Delete install folder after unattended install


Recommended Posts


  • 1 month later...

If i will use del \*FOLDERNAME* /s/q

can i then do it from my application.cmd as the last thing after installing all programs??

If yes.....

How do it have to look?

Like this:

application.cmd file.......

-

-

-

-

ECHO Applying Registry Tweaks...

REGEDIT /S %systemdrive%\install\RegTweaks.reg

ECHO.

del C:\*install* /s/q

echo

Link to comment
Share on other sites

I think it's better to use RD (remove directory).

RD %systemdrive%\install /S /Q

Also, I'm not sure if you can use it from that batch file, since that batch file is probably in the folder you're trying to delete. If it doesn't work, you can try to add it to the registry (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce). Then it will run on next logon.

Link to comment
Share on other sites

It depends on what method you use to install.

If you use batch-files, then put the command as the last one (just before the EXIT) command. If you used the MSFN guide to make this, then probably the last part of start.cmd should look like this:

RD /S /Q %systemdrive%\Install

EXIT

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 :)

Link to comment
Share on other sites

I have tryed to run this reg file and restart

Windows Registry Editor Version 5.00

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

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

But the install folder is still there :-((

Link to comment
Share on other sites

Well, the code looks right to me. If the code worked, you should see a command window for a brief moment after you logon. Also, you can make sure that the value was really imported by opening regedit and navigating to the key. Note that if the command was imported and executed, the value is probably gone (you will have to import the reg file again just to see if the value gets added to the registry).

@kenedy: you got a point there, forgot to mention that you might have to use 2 slashes.

Good luck, I'll be back in about 2 hours.

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