I would like to substitute the target of a desktop shortcut, and I did it. But the problem is, I could not configure the new path as the way I like it to be. The following is my code:
Set wsc = WScript.CreateObject("WScript.Shell")
Set lnk = wsc.CreateShortcut(wsc.SpecialFolders("desktop") & "\Java basics.lnk")
lnk.targetpath = "C:\Windows\System32\wscript.exe ""\\kk-05\apps\network\logon\kbs_logon_file.vbs"""
lnk.arguments = ""
lnk.save
The above code can be compiled and run successfully, but the updated target is :
"C:\Windows\System32\wscript.exe \kk-05\apps\network\logon\kbs_logon_file.vbs"
what I want is:
C:\Windows\System32\wscript.exe "\\kk-05\apps\network\logon\kbs_logon_file.vbs"
The double quotes do not work properly, why can't just use double backslash like this //? It seems that no matter how many / I typed, it only shows one after execution.
use
lnk.targetpath = "C:\Windows\System32\wscript.exe "
lnk.arguments = """\\kk-05\apps\network\logon\kbs_logon_file.vbs"""
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With