Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Creating a .WSH file using SHELLEX

Aug
1,916
68
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
 
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!
 
Hey @vefatica,
Nope, it is part of VBScript, and is documented in the help file;

1593026602715.png


Does the General tab of your Properties Dialog indicate that the type of file is a VBScript Script File?

1593028702533.png


Thanks for the tip about PROPS, much easier.

Joe
 
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
 
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:\>
 
Back
Top