Tuesday, 15 June 2010

javascript - How to make shorcuts on the current directory of a usb drive using vbscript? -


I'm new to coding, and today my purpose is to create a shortcut on the current directory of a USB thumb / flash drive i script Has made some progress, but I'm having problems setting up the target path for the shortcut, because when a plug-in is plugged into a computer to a USB flash drive, they should be automatically assigned the drive letter Security is so shortcuts target path every time is different I do not know that I will how it works. It will be highly appreciated if you guys help me with this one, thanks!
  set to OWS = WScript.CreateObject ("WScript.Shell") sLinkFile = "A.lnk" set ollink = OWS.CreateShortcut (sLinkFile) oLink.TargetPath = "(What is the USB drive letter Should be): \ A.vbs "'Ollink Arguments = "" Ollink. " Description = "MyProgram" 'Olink.Icon Location =' C: \ Xxx \ notporno "'Ollink. Window Style =" 1 "ollink. Save    

A ?? Forsajt

thanks forsajt You actually helped me with this one, here is a part of my solution:

  set strLinkFile = "A.lnk" fso = CreateObject ("Scripting.FileSystemObject") Set oWS = WScript.CreateObject ("WScript.Shell") Set Olink = OWS GameSearch The stroke (strLinkFile) strPath = oWS.CurrentDirectory if fso.FileExists (strPath and "\ Target.file"), then the Ollink target.php = straps & "\ Target.file" ollink. Save & if    

No comments:

Post a Comment