Jump to content

Cleanup


Recommended Posts

Goin through my cleanup.cmd & cannot get both Nero 66014 & Mozilla Firefox 1.04 Desktop shortcuts to go away..delete?

Heres the code relevant to the .cmd

ECHO.
ECHO Please wait...
Echo Removing Nero startsmart desktop Icon....Please Wait
DEL /S /Q "%userprofile%\desktop\*Nero*.lnk"
ECHO.
ECHO Please wait...
Echo Removing Mozilla Firefox desktop Icon....Please Wait
DEL /S /Q "%userprofile%\desktop\*Mozilla Firefox*.lnk"

The .cmd however works but not UA, & before I'm flamed yes I have read quite many pages & searched? I have already manged to solve other shortcut problems but not these two? I have only my administrator acc no others.

Any light guys?

Edited by MAVERICKS CHOICE
Link to comment
Share on other sites


I have posted this one before, it may not be what you want, but this one run as cleanup.cmd will get rid of all the desktop shortcuts

@echo off&setlocal enableextensions
for /d %%a in ("%AllUsersProfile:\All Users=%\*") do if exist "%%~a\Desktop\*" del /q "%%~a\Desktop\*.lnk"
endlocal&goto :eof

It should be on three lines only!

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

I have posted this one before, it may not be what you want, but this one run as cleanup.cmd will get rid of all the desktop shortcuts
@echo off&setlocal enableextensions
for /d %%a in ("%AllUsersProfile:\All Users=%\*") do if exist "%%~a\Desktop\*" del /q "%%~a\Desktop\*.lnk"
endlocal&goto :eof

It should be on three lines only!

Yeah Thanks Yzowl nice code,but there are some links I wanna keep & my cleanup.cmd needs to be such & run last in Ua. :)

Edited by MAVERICKS CHOICE
Link to comment
Share on other sites

They are not in %userprofile% but %AllUsersProfile%

And your syntax is incorrect. Should be Nero*.lnk and Mozilla Firefox*.lnk instead.

And why don't you use the actual name for the shortcuts?

I don't believe they change names from version to versions.

Link to comment
Share on other sites

//Nero 
DEL "%UserProfile%\Application Data\Microsoft\Internet Explorer\Quick Launch\Nero StartSmart.lnk"
DEL "%AllUsersProfile%\Desktop\Nero StartSmart.lnk"

tested and working

run this cleanup command after u install nero.

if your running wpi run it at the every end with cleanup.cmd

Edited by Astalavista
Link to comment
Share on other sites

They are not in %userprofile% but %AllUsersProfile%

And your syntax is incorrect. Should be Nero*.lnk and Mozilla Firefox*.lnk instead.

And why don't you use the actual name for the shortcuts?

I don't believe they change names from version to versions.

OK I will tho the *Nero* does delete all chars before & after "Nero" is just simpler.

Link to comment
Share on other sites

//Nero 
DEL "%UserProfile%\Application Data\Microsoft\Internet Explorer\Quick Launch\Nero StartSmart.lnk"
DEL "%AllUsersProfile%\Desktop\Nero StartSmart.lnk"

tested and working

run this cleanup command after u install nero.

if your running wpi run it at the every end with cleanup.cmd

Thanks Asta taken on board but not sure this is gonna work Ua? Going to retest however.

Edit: Not working live in windows my code above is, but not Ua?

EDIT2: Whats got me is I use the same code for Spybot14 & works great & Astas similar code for the Quicklaunch?

Edited by MAVERICKS CHOICE
Link to comment
Share on other sites

Replacing characters in a variable, copy and paste the following into your text editor, save as xample.cmd and double click it

@echo off&setlocal enableextensions

set MyVar=Some String
echo Your variable is %MyVar%
set NewVar=%MyVar: =_%
echo Your variable is now %NewVar%
set OneMore=%NewVar:S=%
echo Your variable this time is %OneMore%

pause&endlocal&goto :eof

Now look at the output on the screen

So looking at the code you quoted, what I am doing is

  • %AllUsersProfile%\* » C:\Documents and Settings\All Users\*

therefore

  • %AllUsersProfile:\All Users=%\* » C:\Documents and Settings\*

I have replaced the string 'after the colon and before the equals' "\All Users" with the string 'after the equals' "", in effect removing \All Users from the variable.

Edited by Yzöwl
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...