PC Applications forum

General discussion

Deleting Shortcut With Batch File

by Big DB / January 20, 2010 10:44 AM PST

I want to make a batch file that removes the internet explorer icon from my desktop. i tried:
del /f "c:\documents and settings\owner\desktop\internet explorer

please give me an entry that would work. thanx!

Post a reply
Discussion is locked
You are posting a reply to: Deleting Shortcut With Batch File
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: Deleting Shortcut With Batch File
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
Why not just use
by MarkFlax Forum moderator / January 20, 2010 8:12 PM PST

Desktop Properties?

Add or Remove Special Desktop Icons - SUMMARY: Add or remove these Windows XP Desktop icons - My Documents, My Computer, My Network Places, and Internet Explorer

Mark

Collapse -
properties won't help
by Big DB / January 21, 2010 1:02 AM PST
In reply to: Why not just use

No like i want to create a batch file to do it for me, I have multiple computers and it will be easier this way. i just want to remove the IE shortcut and replace it with another via batch file

Collapse -
Ahh.
by MarkFlax Forum moderator / January 21, 2010 3:59 AM PST
In reply to: properties won't help

You didn't mention multiple computers in your first post.

Kees has the right idea.

Mark

Collapse -
Re: batch file
by Kees Bakker / January 21, 2010 3:51 AM PST

That won't work, for 2 (possibly 3) errors
- you should use the full filename (including extension)
- there's a quote missing
The third might be that it's in the All users desktop, not in yours. But I can't check that.

Just go into the command prompt, use cd to browse to the correct folder, use dir to see the full filename. Then try the command from the command prompt until it works. Then copy it to your batchfile.

Kees

Collapse -
There are catches...
by John.Wilkinson / January 21, 2010 4:56 AM PST

1.) There are two kinds of shortcuts that may be present; shortcut files, controlled by the user, and Desktop Icons, controlled by Windows.

2.) Shortcut files may be located in either the user's or the All User's account, resulting in two places to check.

3.) The user's profile location varies based on both username and operating system. Thus, you'll need to use a relative path, not an absolute path.

4.) The shortcut filename(s) can be anything, so you can not delete it programmaticly that way.

5.) Desktop Icons are set by a registry entry, not a file. Thus, you'll have to edit that in your batch file too.

In short, the only guaranteed way is to delete them manually.

John

Collapse -
kees
by Big DB / January 21, 2010 5:34 AM PST

the root of the shortcuts are all in c:\program files\internet explorer\iexplore
is there a way to maybe delete the root and replace it with a file with an identical name so the shortcuts automatically use the new file?

Collapse -
sorry
by Big DB / January 21, 2010 5:35 AM PST
In reply to: kees

in my previous post i should have said that IS the root, not the root is in there.

Collapse -
Re: root
by Kees Bakker / January 21, 2010 5:15 PM PST
In reply to: kees

Shortcuts don't have 'roots' in the common vocabulary. Only file systems have roots (in the computer area).

I've never tried renaming iexplore.exe to, say, iexplore.org.exe and then copying another program (say notepad.exe) it replaces the the original. However, feel free to try. It's easy to undo. And the advantage: it can even be done in a batchfile.

Kees

Collapse -
kees
by Big DB / January 21, 2010 11:19 PM PST
In reply to: Re: root

u know what i meant by roots, its a shortcut it has to have an original file on c: that it launches. but i think renaming it and replacing it may just do the trick and fool the shortcut into thinking its still running iexplore

Collapse -
Not at all...
by John.Wilkinson / January 22, 2010 4:19 AM PST
In reply to: kees

That is not the shortcut, that is the actual Internet Explorer executable. Deleting it will cause Internet Explorer, and any applications that rely on it, to cease functioning, and renaming/replacing it will cause any IE-dependent applications to cease functioning.

-> I suggest that you review my previous post and reconsider.

John

Popular Forums
icon
Computer Help 47,885 discussions
icon
Computer Newbies 10,322 discussions
icon
iPhones, iPods, & iPads 3,188 discussions
icon
Security 30,333 discussions
icon
TVs & Home Theaters 20,177 discussions
icon
HDTV Picture Setting 1,932 discussions
icon
Phones 15,713 discussions
icon
Windows 7 6,210 discussions
icon
Networking & Wireless 14,510 discussions

Tech for the school year

Smart tech for smart students

Forget the pencils and notebooks. Gear up your students with these portable and powerful note-taking machines.