Creating a .WSH file using SHELLEX

SHELLEX is a command from the SYSUTILS plugin, available from;

Take Command Plugins for TCC and TCC/LE Command Prompts

I am using the 64-bit version of SYSUTILS, as I am using the 64-bit version of TCC.

From the SYSUTILS.TXT file;
Code:
SHELLEX

ShellExecute with registered or context menu verb

SHELLEX [/C] [/V verb] <file> [<arguments> [<directory>]]

  /C          use context menu

  /V verb     "print", "edit", "explore" et c.
              (with /C) "properties", "preview", et c.  Without "/V verb",
              the default verb is used if available, else "open" is used.

  /D          (debug) show parameter parsing without executing

  <arguments> and <directory> apply to launching executables

  When appropriate, <file> may specify a URL, a directory or a drive

  Quote parameters containing whitespace; escape necessary quotes as \"
Here is how to create, from TCC, a .WSH file using SHELLEX;
Code:
shellex /c /v "properties" test.vbs
From the context menu, Script tab;
1593015347380.png


I can make the changes that I want, click Apply (or OK), and the test.wsh file is created for me, thus;
Code:
e:\utils>type test.wsh
[ScriptFile]
Path=E:\Utils\test.vbs
[Options]
Timeout=1
DisplayLogo=0
This saves me from having to start Explorer, and then right-click on the .vbs file.

Joe
 
May 20, 2008
10,511
77
Syracuse, NY, USA
If all you need is the "Properties" dialog, SYSUTILS's PROPS command (and save a few keystrokes).

That said, I don't have a "Script" tab in the "Properties" dialog for a VBS file!
 
May 20, 2008
10,511
77
Syracuse, NY, USA
I have this.

1593029304956.png


This seems odd.
Code:
v:\> assoc .vbs
.vbs=VBSFile

v:\> assoc vbsfile
VBSFile=VBScript Script File

v:\> assoc VBScript Script File
VBScript=VB Script Language
And
Code:
v:\> ftype vbsfile
vbsfile="C:\WINDOWS\System32\CScript.exe" /NoLogo "%1" %*
 
Well @vefatica that is not the same as mine.

I have VBScript File (.vbs), while you have VBS File (.vbs)

As for assoc and ftype, it looks the same as on my system;
Code:
e:\utils>assoc .vbs
.vbs=VBSFile

e:\utils>assoc vbsfile
VBSFile=VBScript Script File

e:\utils>assoc VBScript Script File
VBScript=VB Script Language

e:\utils>ftype vbsfile
vbsfile="C:\WINDOWS\System32\CScript.exe" "%1" %*
This is from Windows Settings;

1593031187177.png


Joe
 
May 20, 2008
10,511
77
Syracuse, NY, USA
I don't know much about .WSH files but it seems you could avoid anything GUI with a simple alias. You could probably get quite fancy with a BTM.

Code:
v:\> type template.wsh
[ScriptFile]
Path=
[Options]
DisplayLogo=0

v:\> alias makewsh `copy /q v:\template.wsh .\%@name[%1].wsh & 2>NUL %@iniwrite[.\%@name[%1].wsh,ScriptFile,Path,%1]`

v:\> type wmitest.wsh
TCC: (Sys) The system cannot find the file specified.
 "V:\wmitest.wsh"

v:\> makewsh v:\wmitest.vbs

v:\> type wmitest.wsh
[ScriptFile]
Path=v:\wmitest.vbs
[Options]
DisplayLogo=0

v:\>