openwith function and redirecting command line output with >
Posted: 17 Jun 2009 22:39
I'm loving XY still, and trying to do some more automation but just ran into a stumbler that's probably simple. I want to use openwith to call a program. The program takes a filename as its second argument, then writes out a SHA256 hash. I want to redirect the programs output to a file using the '>' redirection.
Normally I run this program from the command line as:
c:\hasher sha256 filein > fileout
Where sha256 is the program's first argument telling it what type of hashing to do. I've been playing with openwith to the point of frustration so now I'm posting for help. I've tried stuff like:
::openwith """C:\hasher.exe"" sha256 ""<curitem>"" > ""<curitem>.sha256"""
::openwith "C:\hasher.exe" sha256 "<curitem>" > "<curitem>.sha256"
::openwith "C:\hasher.exe" sha256 "<curitem>" '>' "<curitem>.sha256"
Normally I run this program from the command line as:
c:\hasher sha256 filein > fileout
Where sha256 is the program's first argument telling it what type of hashing to do. I've been playing with openwith to the point of frustration so now I'm posting for help. I've tried stuff like:
::openwith """C:\hasher.exe"" sha256 ""<curitem>"" > ""<curitem>.sha256"""
::openwith "C:\hasher.exe" sha256 "<curitem>" > "<curitem>.sha256"
::openwith "C:\hasher.exe" sha256 "<curitem>" '>' "<curitem>.sha256"