Jump to content

remote shortcut


Kunal
 Share

Recommended Posts

Hi, i need to put a shortcut on a remote computer and have it ask for what is the target pc.

below is what i have but it doesnt work when i run it in autoit

Global $inputbox = InputBox("What's the computer name?", "Please provide Computer Name?")

Global $link = @DesktopDir & "\my_shortcut.lnk"

FileCopy($link, "\\" & $inputbox "\c$\Documents and Settings\All users\Desktop")

Can anyone help?

Thanks

Kunal

Link to comment
Share on other sites

The correct syntax would be:

FileCopy($link, "\\" & $inputbox &"\c:\Documents and Settings\All users\Desktop")

Hi,

i tried to run it and it ran ok but did not place the shortcut on the target pc.

thanks for your help

Kunal

Link to comment
Share on other sites

Hi,

i tried to run it and it ran ok but did not place the shortcut on the target pc.

thanks for your help

Kunal

Try it:

$comp_name = InputBox("What's the computer name?", "Please provide Computer Name?")

If Not $comp_name = "" Then
    FileCreateShortcut(@ProgramFilesDir & "\MyProgram\file.exe", @ScriptDir & "\file.lnk", @ProgramFilesDir & "\MyProgram")
    FileCopy(@ScriptDir & "\file.lnk", "\\" & $comp_name & "\c:\Documents and Settings\All users\Desktop")
EndIf

A function FileCreateShortcut() returned 1 if success or 0 if lnk cannot be created, but not returned path and name to lnk file.

Link to comment
Share on other sites

Only local drives use ":" like "c:" . Networks go with "$" like "\\127.0.0.1\c$" .

Oh ok, from the script above. How do i set the vars so that it reads the file form a network share as in \\server , just not sure on what to put as the variables to get the script working.

thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...