A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » General XP issues or comments
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

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



 
 
Thread Tools Display Modes
  #1  
Old February 21st 12, 01:27 AM posted to microsoft.public.windowsxp.general
(PeteCresswell)
external usenet poster
 
Posts: 1,933
Default 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
Ads
  #2  
Old February 21st 12, 02:08 AM posted to microsoft.public.windowsxp.general
(PeteCresswell)
external usenet poster
 
Posts: 1,933
Default 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
  #3  
Old February 21st 12, 02:40 AM posted to microsoft.public.windowsxp.general
(PeteCresswell)
external usenet poster
 
Posts: 1,933
Default 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
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 07:00 PM.


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