Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
batch file name from selected file
Name: mainegate Date: August 15, 2007 at 20:31:46 Pacific OS: xp CPU/Ram: 1 gig Product: compaq
Comment:
So I figured out how to add a menu when someone right clicks on a .mov or .avi and then they can click and it runs a batch file. That works great but how would I go about getting the file name from the file that I right clicked from?
My menu says Convert to Blah and now it does some command line stuff based on a specific folder or file that I have to hard code. Is there a way I can get the file name and extention of the file that I right clicked on, regardless of where the file is..is there a directory\Path\%file% kind of thing?
Name: Razor2.3 Date: August 15, 2007 at 21:58:38 Pacific
Reply:
%~f1 Read more: FOR /? (Look for the list that starts out with %~I, and replace "I" with "1".)
0
Response Number 2
Name: mainegate Date: August 15, 2007 at 23:36:46 Pacific
Reply:
I understand %~f1 will get the full qualified path but the question is how can I right click on a file and have that full qualified path be put into a variable so I can call it in my other command line?
Not dragging the file onto the .bat...only right clicking on the file...is this possible?
0
Response Number 3
Name: Razor2.3 Date: August 16, 2007 at 00:39:55 Pacific
Reply:
Assuming you correctly followed the instructions you posted in your context menu post? %~f1
If you want to save the name in some sort of list, or in some sort of environment variable (for another program/script), then you'll have to write a script to do that.
0
Response Number 4
Name: mainegate Date: August 16, 2007 at 04:06:06 Pacific
Reply:
It works. I actually had the code already and didn't realize it. Thanks for your patience.
Summary: Hi, I have a directory set up that stores *.CSV files. I need to read the file name of the file, create a directory with the same file name, move the *.csv file into the new directory and rename the ...
Summary: How would I go about writing a batch file to copy all the file names in a folder...just the file names not the files and then rename them to something standard like "video1.avi", "video2.avi",etc. THE...
Summary: I have a text file with one line of text [may contain multiple words] that I need to 'read' back into my batch file as a variable. This variable is the directory where the user's IE Favorites will be ...