WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Shortcut Information

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Delete a Folder Shortcut

 Keywords:  Delete Remove Folder Directory Dir Shortcut ShortcutMake

Question:

Using Winbatch, I have created a shortcut to a directory.
linkfile = "D:\Documents and Settings\All Users\Start Menu\Programs\Symantec Endpoint Protection\Documents"
ShortcutMake (linkfile, "C:\TEMP\TT", "", "", @NORMAL, 1)
If I find I want to delete the shortcut later, how do I do it?

Answer:

You would use the function DirRemove. However in order to use DirRemove you first have to delete all the files in the folder. The code would look something like this:
ShortcutMake ("f:\sample", "F:\TEMP\TT", "", "", @NORMAL, 1)
FileDelete("f:\sample\*")
DirAttrset("f:\sample", "rs") 
DirRemove("f:\sample")

Article ID:   W18277
Filename:   Delete a Folder Shortcut.txt
File Created: 2009:09:24:10:09:18
Last Updated: 2009:09:24:10:09:18