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.
Getting a file name into a variable
Name: Tony D Date: November 7, 2008 at 07:17:52 Pacific OS: XP CPU/Ram: several Product: Dell
Comment:
Hi,
I am trying to create a batch file that searches a directory for a particular file and then uses the exact name of that file as a variable used as an input for another program. For example, below is a two-line snippet of the batch file:
This makes the file name "UDC3500_FLASHK8V4F.abs.s19" into a variable which is then used as the input to the sreccvt program. Now, the above snippet works fine for the specific file "UDC3500_FLASHK8V4F.abs.s19" but what I would like to do is search the directory for any file of the form "UDC3500*.abs.s19" <note wildcard> and then put the exact name of the found file into the "filename" variable.
The directory will only contain a single "UDC3500" file.
Summary: I need to go thru a folder and insert the first 10 letters of the text file name into the first line of those individual files. Im not experienced at programing but know how to execute the bat file fr...
Summary: I need my batch file to do something (or not) based on the size of another file. I have a file called c:\myfile.txt and I need a batch file that will read myfile.txt's file size into a variable. I ...
Summary: I am trying to copy a file then get the file name to use in another variable. It might make more sense when I show you the batch script. set /p cop= copy %cop% c:\g77 set in= I drag a file into the cm...