Name: mholden58 Date: June 18, 2005 at 17:06:00 Pacific Subject: Bat file remembers file name?? OS: windows xp CPU/Ram: dont know
Comment:
Hi I have had no luck with this question on the xp forum, maybe someone here can help. I used to dabble with bat files 15-20 years ago, but am really rusty now. Is it possible for a bat file to extraxt the filename from a randomly named file that always has the same extension lets say random.hex, save it it some way, and then rename a different file random_cks.hex. Please bear in mind I want it to find the randomly named file, (which will be the only .hex in that particular directory)I don't want to type in the name of the file. Thanks in advance, any help appreciated. Martin.
I'm not sure that I understand what you want this batch to do, but bear in mind that WinXP has no true DOS, but a command line emulation which uses an 'extended' command set - one of the very reasons for the message "This forum is for all Standalone versions of DOS, not the "DOS" prompt contained inside later versions of Windows."
Suggest reposting again in WinXP or else maybe Programming
Life is hard; it's harder if you're stupid. -John Wayne
Thanks M2. It is there, jboy, but seems to have died, it's on page 2.
M2, (or any other guru's out there.) I ran a test with your script, it works for renaming a .hex file. Problem is I need to take it a step further. I need to sort of separate it out into two parts. I'll give more detail: The parts in lower case work already, the parts in upper case are the parts I need help with (I'm not shouting!) I move a meaningfully named (but it's always different) hex file into a directory. I THEN WANT TO SAVE THE FILENAME IN SOME WAY I then have to change it to another name (newhex.hex) so another batch file can process it. The batch file outputs a new file with another fixed name (crunched.hex) I then delete the original file (newhex.hex) I THEN WANT TO RENAME THE NEW FILE (always called crunched.hex) WITH THE FILENAME SAVED FROM THE ORIGINAL FILE. I can then use the script above to add the _cks suffix.
Eagerly waiting input from people far cleverer than me. Thanks again for helping. Martin.
What can i say? M2, thanks very much indeed! I ran a test and it works perfectly. Thanks for taking the time to work out what I wanted. isn't the internet wonderful! Thanks again. Martin.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE