Deleting desktop shotcuts after login script ran

Hi Guys,

I use Win XP Pro (SP 2).

When I log into my company's domain, the login script places approx. 15 shortcut icons on my desktop (which includes shortcuts to MS office, several network resources and even Windows Media player).

I never us any of these and it just clutters up my desktop.

The sysadmins can't remove this from the login script, as some employees use them.

Is it possible to place a script in the Start up Folder, which will run after the login script has executed, which will delete the icons from my desktop?

What would this "clean-up" script contain?

Thank you.

jo
LVL 1
m0nk3yzaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Frosty555Commented:
You could make a .BAT file that deletes the shortcuts. The code would be something like:

@echo off
del "%userprofile%\desktop\Microsoft Office Word 2003.lnk"
del "%userprofile%\desktop\Some other icon.lnk"
del "%userprofile%\desktop\Some network resource.lnk"

And drop that into your startup folder. You'd need to make sure this got executed AFTER the logon script from your domain got executed (otherwise the icons wouldn't have arrived yet!). If it's always getting executed first... you can just put the file on your desktop and doubleclick it when your system has loaded.

Shortcuts on your desktop are just ".lnk" files, where the name of the file is the caption on the icon

0
stopReplyingCommented:
write in Notepad the snippet and save it as .BAT or .CMD file.
Copy it onto your Start Up menu and that is all done.
@echo off
DEL /F "%USERPROFILE%\Desktop\office*.lnk"
DEL /F "%USERPROFILE%\Desktop\any other file.txt"

Open in new window

0
psyclown-Commented:
It should be possible to do so, or atleast you could put a registry string in your registry database, to startup with windows.

You should make a .bat script, with something like this:

Delete c:\documents and settings\[Your account]\Desktop\[filename]

Then put in one line for each file.

Then go to start > run, and type regedit, and go to the following:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Make a new key with the type "REG_SZ" and value should be the path to the .bat file you just made.

Hope that can help you, and will work for you.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

m0nk3yzaAuthor Commented:
Hi Guys,

Thanks for the response.

The login script seems to be executed after this .BAT file.

So the shortcuts are deleted, then recreated by the login script.

Any ideas on how to delay the execution on the .BAT file?

Thank you.

jo
0
Frosty555Commented:
You could make the bat file pause for a few seconds before performing the delete operation, giving the icons time to be created.

Unfortunately .BAT don't have any intrinsic wait commands. There used to be a TIMEOUT command but I don't see it anymore.

But there's a workaround! You can use "Ping" to ping a nonexistant IP address with a specific timeout delay ;)

To wait four seconds:

ECHO Waiting for four seconds...
PING -w 4000 -n 1 1.1.1.1 >nul  
0
stopReplyingCommented:
like my fellow expert has mentioned you could ping a non existing IP address.
you can modify it depending on how much time you need.
1 failed ping response = 4 seconds
so you can do the following:

in the code "PING -w 4000 -n 3 1.1.1.1 >nul" you can substitute the number 3 with as many you need. (3 meaning the number of times PING packages are being sent) and also the wait time (-w 4000, meaning "wait 4000 milliseconds before sending another package).

another thing: it is important to put the path in quotes, or it will not be recognized, due to spaces in the path.
Good Luck
@echo off
echo waiting...
PING -w 4000 -n 3 1.1.1.1 >nul
echo erasing... 
DEL /F "%USERPROFILE%\Desktop\Microsoft*.lnk"
DEL /F "%USERPROFILE%\Desktop\any other file.txt"

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows XP

From novice to tech pro — start learning today.