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

PSHELL: How pass arguments to script?

$
0
0
Here's a little Powershell script.

Code:
# cmenu.ps1
$o = new-object -com "Shell.Application"
$folder = $o.NameSpace($args[0])
$file = $folder.ParseName($args[1])
$file.InvokeVerb("Properties")

It works (opens the Properties dialog) in Powershell if I give it a foldername and a filename; for example,

{code]PS> cmenu.psi d:\tc26 tcc.exe[/code]

If, instead of arg[0] and arg[1], I hard-code a foldername and a file name, it runs OK with TCC's PSHELL.

But I can't figure out how call it with...

Read more

Viewing all articles
Browse latest Browse all 1772

Trending Articles