Deleting a Desktop shortcut ... remotely 
Author Message
 Deleting a Desktop shortcut ... remotely

Ok, just some clarifications...

If all the machines in which you need to delete a desktpo shorcut are NT, ok, there are absolutely no problem.
Install ADSI in the machine that perform the task.
Now, suppose taht i need to delete the file C:\Strange\Rainbow.lnk in the machine CompName...

1)Create a program that, with ADSI, make a share to the drive where the shortcut is (C:), call it with the "$" as end character (this make invisible the share to the user) (C$)
  Set objComputer = GetObject("WinNT://CompName/LanmanServer")
  Set objShare = objComputer.Create("FileShare", "C$")
  objShare.path = "C:\"
  objShare.SetInfo

2)When you call objFileSystem.DeleteFile, use this sintax:
 objFileSystem.DeleteFile "\\CompName\c$\Strange\Rainbow.lnk")

3)Remove the share
  Set objComputer = GetObject("WinNT://CompName/LanmanServer")
  objComputer.Delete "FileShare", "C$"

4)Watch how easy is this program...

The real problem append when you need to do this on 95/98 machine, because them don't support the creation of file share with ADSI (i think, someone can deny me...), so or in all the machines exists
the C$ condivision or... I don't know... :(( Sorry

.Enjoy.
Legolas

Quote:

> Hi,

> I understand the creation and deletion of shortcuts, such as in the script below. But how do I execute this on a remote machine?

> Essentially I need to have the WSHShell be a remote computer on the network. How do I go about doing that? I've heard of DCOM and other items, but haven't seen concrete info on how to use them.

> Thanks for any help,
> = Derek Brost




Mon, 10 Dec 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Deleting a Desktop shortcut ...

2. Deleting a Desktop shortcut ...

3. how to delete a shortcut on the desktop

4. Full screen IE on desktop shortcut

5. Desktop shortcut target problem

6. Create shortcut in desktop

7. How to Make a Shortcut on Desktop?

8. desktop shortcut WSH

9. creating a desktop-shortcut

10. putting arguments in the TargetPath of a desktop shortcut

11. Desktop shortcut coordinates

12. How To Enumerate All Shortcuts On My Desktop

 

 
Powered by phpBB® Forum Software