Jump to content

Recommended Posts

Posted

I'm having problems deleting some files and shortcuts, as they reappear after final reboot. (If I remove after final reboot, they will not reappear).

e.g removing favourites will not stick.

for /d %%g in ("%UserProfile%\Favoritter\*") do rd /s /q "%%g"

for %%g in ("%UserProfile%\Favoritter\*") do del /f /q "%%g"

Any ide how to solve this?


Posted

your commands are executed @ RunOnceEx or cmdlines.txt ? because at RunOnceEx no users are created yet ...

Posted
They are run when desktop and all is loaded and waiting for final reboot.

The start menu is loaded too ? if not ... no users are logged so you can try this :

CleanUp.cmd

your commands here.

del /f %0

Copy this file in $OEM$\All users\Start menu\Startup

So when any first user will be logged the batch will be executed and cleans and delete itself.

Posted

Yep, I actually already prepped a file like that as a "last resort" hehe ;)

But couldn't this be done a bit smoother, like add another RunOnceEx entry where I would normally have the cleanup commands run, that runs the same batch? Would look a bit better, and if it would work reg entries would also apply.

What do you think?

Posted

I'm not sure exactly what shortcuts you're trying to clean up, but I believe there some that are created from registry commands or something. They're a complete pain in the butt too. I've basically got all of them taken care of with the exception of "Address Book". Having the following in your WINNT.SIF will eliminate a lot of the bothersome shortcuts:

[Components]
IEAccess=off
OEAccess=off
WMAccess=off
WMPOCM=off

Posted
Yep, I actually already prepped a file like that as a "last resort" hehe ;)

But couldn't this be done a bit smoother, like add another RunOnceEx entry where I would normally have the cleanup commands run, that runs the same batch? Would look a bit better, and if it would work reg entries would also apply.

What do you think?

You can make a batch executed at the end of the first roex and inside the batch

SetFinalCleanup.cmd

@echo off

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "Final Cleanup" /f

REG ADD %KEY%\001 /VE /D "Cleanup" /f

REG ADD %KEY%\001 /V 1 /D "%systemdrive%\Cleanup.cmd" /f

::Fix a reboot after 1min of the logon process ...

::So the runoncex will be re-executed with the new command

shutdown -r -t 60

The content of Cleanup.cmd is same as my previous post.

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