Quantcast
Channel: Take Command / TCC
Viewing all articles
Browse latest Browse all 1808

Determine if a .vbs is running from SCRIPT or CSCRIPT

$
0
0
I wanted to know if I was running a .vbs (VBScript) file from either the TCC Script command, or CScript.exe.

The following .vbs (VBScript) file can be run from either the TCC Script command, or CScript.exe, to determine where the .vbs is running from.
Code:
' VbsEdit Toolkit is part of VBSEdit.

Set tk = CreateObject( "VbsEdit.Toolkit" )

PID = tk.CurrentProcessID
PIDModule = tk.ModuleFilenameFromProcessId(PID)

if right(PIDModule,7) = "tcc.exe" then
  with TakeCommand
    .tcommand("echo The...

Read more

Viewing all articles
Browse latest Browse all 1808

Trending Articles