How do I create a shortcut remotely on WinNT? 
Author Message
 How do I create a shortcut remotely on WinNT?

The concept is the same, but with a little difference:

1)Create your shortcut locally, maybe in the temp folder
2)copy, with ADSI and FileSystemObject, the shortcut on others machines, using the same sintax of objFileSystem.DeleteFile call (for the \\CompName\c$\etc.) :)

If you need more clarifications, just ask me...

.Enjoy.
Legolas

Quote:

> Hi,

> I got a helpful response back on my question regarding deleting a shortcut remotely using ADSI. Now I am curious how I go about creating a shortcut remotely.

> I have the following jscript to create an icon and it works when I run it on my PC, but how do I set this up to run from my administration machine and to create the shortcut on another machine on
> the network (or for that matter to a list of 250+ machines on the network)?

> Thanks for your help! I really like the prospect of remote administrative tasks using WSH, but I just don't understand the "remote" part of it all.

> The code follows...

> =Derek Brost

> ----------------- jscript ----------------------
> // *****************************************************
> // *
> // * IBM 3270 Terminal Shortcut Script
> // *

> var LaunchPath = "C:\Program Files\NETMANAG.32\TN3270.exe"
> var LaunchArg = "-c IBM"
> var StartIn = "C:\Program Files\NETMANAG.32"
> var IconPath = "C:\Program Files\NETMANAG.32\TN3270.exe"

> var WSHShell = CreateObject("WScript.Shell");
> var DesktopPath = WSHShell.SpecialFolders("AllUsersDesktop");
> var MyShortcut = WSHShell.CreateShortcut(DesktopPath + "\\IBM 3270 Terminal.lnk");

> MyShortcut.TargetPath = LaunchPath
> MyShortcut.Arguments = LaunchArg
> MyShortcut.WorkingDirectory = StartIn
> MyShortcut.WindowStyle = 4
> MyShortcut.IconLocation = IconPath
> MyShortcut.Save();



Mon, 10 Dec 2001 03:00:00 GMT  
 How do I create a shortcut remotely on WinNT?

How do I create a shortcut remotely on WinNT?If I recall, the delete shortcut solution you got was to use ADSI to create a temp share and a Scripting.FileSystemObject and the DeleteFile method to reference the share.

To create the shortcut, you do essentially the same thing, except that once you have the share, use a WScript.Shell object and it's CreateShortcut method...

--
Michael Harris

Hi,

I got a helpful response back on my question regarding deleting a shortcut remotely using ADSI. Now I am curious how I go about creating a shortcut remotely.

I have the following jscript to create an icon and it works when I run it on my PC, but how do I set this up to run from my administration machine and to create the shortcut on another machine on the network (or for that matter to a list of 250+ machines on the network)?

Thanks for your help! I really like the prospect of remote administrative tasks using WSH, but I just don't understand the "remote" part of it all.

The code follows...

=Derek Brost

----------------- jscript ----------------------
// *****************************************************
// *
// * IBM 3270 Terminal Shortcut Script
// *

var LaunchPath = "C:\Program Files\NETMANAG.32\TN3270.exe"
var LaunchArg = "-c IBM"
var StartIn = "C:\Program Files\NETMANAG.32"
var IconPath = "C:\Program Files\NETMANAG.32\TN3270.exe"

var WSHShell = CreateObject("WScript.Shell");
var DesktopPath = WSHShell.SpecialFolders("AllUsersDesktop");
var MyShortcut = WSHShell.CreateShortcut(DesktopPath + "\\IBM 3270 Terminal.lnk");

MyShortcut.TargetPath = LaunchPath
MyShortcut.Arguments = LaunchArg
MyShortcut.WorkingDirectory = StartIn
MyShortcut.WindowStyle = 4
MyShortcut.IconLocation = IconPath
MyShortcut.Save();



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

 Relevant Pages 

1. Deleting a Desktop shortcut ... remotely

2. Creating a PostScript file under WinNT

3. Creating EPS from MSWord Document on WinNT

4. Create WinNT Domain Users

5. Create WinNT Domain Users

6. WinNT 4.0 - Error registering the OCX C:\WINNT\System32\wshom.ocx

7. Back button or create a shortcut

8. Creating ShortCuts on Descktop with VB script ?!?!?!?!

9. Create windows shortcuts

10. Automatically create shortcut ...

11. Hell of a Time - Detect Plugins, Close Parent Window, Detect 128 bit Encryption Browser, create Shortcut

12. Create shortcut in desktop

 

 
Powered by phpBB® Forum Software