Right-Click File Name And Pass It To .CMD File?

P

(PeteCresswell)

I'd like to set up my XP machine so that if I right-click on a
file, a .CMD will be executed with the file name passed to the
command file.

e.g. If I right-click on a file named "Payroll.xls", XP will
start a .CMD file named SecureZip.cmd and pass "Payroll.xls" to
it as a parm.

FWIW, within the command line we will have something like:

"c:\program files\winzip\wzzip.exe" -smypw -ycAES256 payroll
payroll.xls


The idea being the ability create an encrypted .ZIP file by
clicking on the file we want to zip - without having to click
around in the WinZip UI.

Or am I just wishing?
 
P

(PeteCresswell)

Per (PeteCresswell):
I'd like to set up my XP machine so that if I right-click on a
file, a .CMD will be executed with the file name passed to the
command file.

e.g. If I right-click on a file named "Payroll.xls", XP will
start a .CMD file named SecureZip.cmd and pass "Payroll.xls" to
it as a parm.

I withdraw the question.

Per http://tinyurl.com/7ensq6k... somebody thinking out of the
box came up with the fact that if one puts an icon to the .CMD
file on the desktop and drags/drops a file on to the icon, the
file's name gets passed as Argument(0)... even easier/quicker
than right-clicking IMHO.
 
P

(PeteCresswell)

Per (PeteCresswell):
Per http://tinyurl.com/7ensq6k... somebody thinking out of the
box came up with the fact that if one puts an icon to the .CMD
file on the desktop and drags/drops a file on to the icon, the
file's name gets passed as Argument(0)... even easier/quicker
than right-clicking IMHO.

Here's the final product:

================================================================
"c:\program files\winzip\wzzip.exe" -a -ssandow -ycAES256
"%~d1%~p1%~n1.zip" %1

:* PAUSE
================================================================

With allowance for newsreader's text folding....

Put that puppy into a .CMD file.

Then put a shortcut to said .CMD file anywhere that is
convenient.

Now just drag/drop a file on to the shortcut and you'll wind up
with a like-named .ZIP file in whatever directory the original
file was in.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top