Jump to content

How come my RunOnceEx.cmd file isn't working?


Recommended Posts

This is how my Cleanup.cmd file looks like

@echo off

RD /S /Q \"%systemdrive%\Documents and Settings\Administrator\Favorites\Links

RD /S /Q \"%systemdrive%\Documents and Settings\Administrator\Favorites\Favorites

RD /S /Q %systemdrive%\drivers

del /f /q %systemdrive%\cleanup.cmd

Here is one I corrected for you

It was missing some stuff.

You Need To Have " These At The Begging And End"

Changed The Cmd Screen To Be Smaller

Change The Background To White

Change The Text To Dark Blue

Added A Title

@echo off

CLS

Mode 55,5

Color F1

Title Ua Clean Up

RD /S /Q "%systemdrive%\Documents and Settings\Administrator\Favorites\Links"

RD /S /Q "%systemdrive%\Documents and Settings\Administrator\Favorites\Favorites"

RD /S /Q %systemdrive%\drivers

del /f /q %systemdrive%\cleanup.cmd

Link to comment
Share on other sites


Changing colors is for apperance only or did you not know that.

It just to make it look better than the standard black and white.

If it not to hard you could take out this line Color F1 but that might

require some thinking on your part.

I am just in the habbit of adding it to my Cmd scripts.

Link to comment
Share on other sites

Changing colors is for apperance only or did you not know that.

It just to make it look better than the standard black and white.

If it not to hard you could take out this line Color F1 but that might

require some thinking on your part.

I am just in the habbit of adding it to my Cmd scripts.

Not that I don't appreciate that, but my problem is not with asthetics right now. I'm trying to get my script working. Colours are the last thing that I need to worry about :blink:

Link to comment
Share on other sites

@ Sgt_Strider

The colourful reply from gunsmokingman has the correct syntax!

Here is mine in monochrome format

@echo off
rd /s/q "%UserProfile%\Favorites\Links"
rd /s/q "%UserProfile%\Favorites\Favorites"
rd /s/q %systemdrive%\drivers
del %0

Hope this helps!

Link to comment
Share on other sites

@ Sgt_Strider

The colourful reply from gunsmokingman has the correct syntax!

Here is mine in monochrome format

@echo off
rd /s/q "%UserProfile%\Favorites\Links"
rd /s/q "%UserProfile%\Favorites\Favorites"
rd /s/q %systemdrive%\drivers
del %0

Hope this helps!

I see! I apologize if I seemed rude at all in my post.

I copied and paste your syntax into my cleanup.cmd and it doesn't work. The favourites and link folder appears under the favourites tab in IE. I honestly don't know what is going on and I am becoming very frustrated.

Link to comment
Share on other sites

It might have to do with the desktop top not being loaded up when the script runs

this is only a guess.

Since this is a cleanup it might be better to do the install make sure the desktop is

loaded up, reboot have the cleanup.cmd start after that reboot.

Hope this helps.

Link to comment
Share on other sites

stop bumping your thread!

It's annoying.

the lines that they gave you are not hard to figure out. The only tough one MIGHT be the del %0 which is deleting the current directory.

Did you happen to think that maybe you have the paths screwed up, or that the files themselves don't get created untill the desktop loads?

Link to comment
Share on other sites

stop bumping your thread!

It's annoying.

the lines that they gave you are not hard to figure out. The only tough one MIGHT be the del %0 which is deleting the current directory.

Did you happen to think that maybe you have the paths screwed up, or that the files themselves don't get created untill the desktop loads?

To you it may not be hard, but to me it's like learning calculus. I've tried it again and again and I still can't get it to work. Yes it may be annoying to you, but if I don't bump it now, how am I going to get any answers?

Link to comment
Share on other sites

Can you post your current batch file,explain when you are running it, where you are running it from, (with example).

Also where does the favorites sub-folder inside the favorites folder come from?

<Edit>

Note - the del %0 deletes the currently running batch file not the current directory

</Edit>

Edited by Yzöwl
Link to comment
Share on other sites

Can you post your current batch file,explain when you are running it, where you are running it from, (with example).

Also where does the favorites sub-folder inside the favorites folder come from?

<Edit>

Note - the del %0 deletes the currently running batch file not the current directory

</Edit>

This is how my RunOnceEx.cmd file

@echo off

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

REG ADD %KEY%\001 /VE /D "Removing Items" /f
REG ADD %KEY%\001 /V 1 /D "%systemdrive%\cleanup.cmd" /f

This is how my Cleanup.cmd file looks like:

@echo off
RD /S /Q "%systemdrive%\Documents and Settings\Administrator\Favorites\Links"
RD /S /Q "%systemdrive%\Documents and Settings\Administrator\Favorites\Favorites"
RD /S /Q %systemdrive%\Drivers
del /f /q %systemdrive%\Cleanup.cmd

The drivers within C:\ is deleted, but the favourites and links folder still appears. I think it actually does delete those folders, but maybe after a restart, Windows reinstall those folders? Is something missing? Am I not understanding this properly?

Link to comment
Share on other sites

OK,OK,OK

I think i understand your problem....

When your command "delete favorites" runs there is no admin folder yet. but your code will work if your time it correctly...

You have to wait until after your desktop profile is created.

If you change the code to delete the default user "favorites" then no account with get those folders, it is all up :whistle: to you......

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