PCbanter

PCbanter (http://www.pcbanter.net/index.php)
-   General XP issues or comments (http://www.pcbanter.net/forumdisplay.php?f=18)
-   -   Right-Click File Name And Pass It To .CMD File? (http://www.pcbanter.net/showthread.php?t=1084618)

(PeteCresswell) February 21st 12 12:27 AM

Right-Click File Name And Pass It To .CMD File?
 
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?
--
Pete Cresswell

(PeteCresswell) February 21st 12 01:08 AM

Right-Click File Name And Pass It To .CMD File?
 
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.
--
Pete Cresswell

(PeteCresswell) February 21st 12 01:40 AM

Right-Click File Name And Pass It To .CMD File?
 
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.

--
Pete Cresswell


All times are GMT +1. The time now is 10:53 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2004 - 2006 PCbanter
Comments are property of their posters