ZTree.com  | ZEN  | About...  

 Index   Back

[Help!] VBS shortcut making with many arguments in a target   [Help!]

By: Ryan       
Date: Nov 30,2018 at 03:51
In Response to: [Help!] VBS shortcut making with many arguments in a target (Martijn Coppoolse)

hi

many thanks to you, AA= is wokring very nicely
------------------------------------------
AA=
set WshShell = WScript.CreateObject("WScript.Shell" )
set oShellLink = WshShell.CreateShortcut(Wscript.Arguments.Named("shortcut") & ".lnk")

oShellLink.TargetPath = Wscript.Arguments.Named("Target")

T1 = Wscript.Arguments.Named("Arg1")
T2 = Wscript.Arguments.Named("Arg2")
T3 = Wscript.Arguments.Named("Arg3")
T4 = Wscript.Arguments.Named("Arg4")
T5 = Wscript.Arguments.Named("Arg5")
T6 = Wscript.Arguments.Named("Arg6")
oShellLink.Arguments = T1 & " " & T2 & " " & T3 & " " & T4 & " """ & T5 & """ """ & T6 & """"

oShellLink.WorkingDirectory = Wscript.Arguments.Named("startin")
oShellLink.IconLocation = Wscript.Arguments.Named("Icon")

oShellLink.WindowStyle = 1
oShellLink.Save
--------------------------------------------
AA='s possible answers are below
'C:\ZTREE\ZTW.EXE /M /Y a b "C:\ZTREE\F9" "VBS MAKE SHORTCUT 1 - ARG 6.VBS"
'C:\ZTREE\ZTW.EXE /M /Y "C:\ZTREE\F9" "VBS MAKE SHORTCUT 1 - ARG 6.VBS"

**************************
**************************
BB=VBS MAKE SHORTCUT 2 - DATA.VBS {type 2 way}

Target = WScript.Arguments.Unnamed(0)
Arg = WScript.Arguments.Unnamed(1)
Shortcut = WScript.Arguments.Unnamed(2)
Startin = Wscript.Arguments.Unnamed(3)
Icon = Wscript.Arguments.Unnamed(4)

Set objShell = WScript.CreateObject("WScript.Shell")
Set lnk = objShell.CreateShortcut(Shortcut & ".lnk")

lnk.TargetPath = Target
lnk.Arguments = """" & Arg & """"
lnk.WorkingDirectory = Startin
lnk.IconLocation = Icon

lnk.Save
'Clean up
Set lnk = Nothing
------------------------

a batch file to carry out BB=
@ECHO OFF
SET C1=C:\ZTREE
SET C2=C:\ICON
SET COLOR=PINK 1.ICO
SET H1=%C1%\F9\VBS MAKE SHORTCUT 2 - DATA.VBS

SET P1=/Target:"%C1%\ZTW.EXE"
SET P2=/Arg:"/M"
SET P3=/Shortcut:"C:\Documents and Settings\CCC\Desktop\AAA BBB.TXT"
SET P4=/Startin:"%C1%"
SET P5=/Icon:"%C2%\%COLOR%"

"%H1%" %P1% %P2% %P3% %P4% %P5%


I thought i had BB= working a while ago, my guess was wrong.
is it possible to give me a pointer?, an error couldnt be too far off.

58 views      
 

Messages in this Thread

 
93,933 Postings in 11,850 Threads, 347 registered users, 4 users online (0 registered, 4 guests)
Index | Admin contact |   Forum Time: Dec 10, 2018 - 3:13 pm EST  |  Hits:26,926,080  (2,548 Today )
RSS Feed