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.
removing quotes from batch variable
Name: fillae Date: January 30, 2003 at 11:03:54 Pacific OS: win2k server CPU/Ram: dual 600 / 1gig
Comment:
Ok, I've been wrestling with this for some time now. I have a text file that has a directory path on each line. Each path entry in the file is double-quoted to handle long file names. Is there a way to remove the quotes either by:
1) putting the path in a variable without the quotes?
2) putting the path in another text file without the quotes?
3) putting short paths into the file to begin with so the double quotes are not needed?
Name: dtech10 Date: January 30, 2003 at 14:15:01 Pacific
Reply:
Hi fillae I have an old dos program that I got from "PC Magazine" I think it lets you change text files. In your case you would type Change.exe Filename 34 "" you can use text within quotes and the askii codes. It works ok on my system WinXP Pro. Hope this helps
0
Response Number 2
Name: Secret_Doom Date: January 30, 2003 at 20:15:25 Pacific
Reply:
You can use the FOR cmd to process the filename, passing each line to a certain variable (like %%A), removing surrounding quotes:
for /F "delims=" %%A in (FILENAME.EXT) do echo PATH=%%~A
Name: fillae Date: January 31, 2003 at 11:43:30 Pacific
Reply:
Thanks for the responses.
I was actually able to work through this one with some experimenting. My solution was:
dir %2 /s /b > NewPath.txt for /f "delims=" %%a in (NewPath.txt) do set DirPath=%%a del NewPath.txt
The %2 variable was double-quoted, but by putting it into a text file, then doing a for loop to put it in another variable, it removed the quotes. Not sure if this is a great method or not, but it is working.
Summary: I just got new monitor and installed CD came with it. After I reboot, the computer stops and monitor does not display anything. I restarted my computer without monitor but the computer stops runing....
Summary: *** Thank U:) Mr. Pignataro Is there an easier way to delete a single value inside of a registrykey (from a batchfile), cause I don't get it! I think both John & I are newbies so could U please be mor...
Summary: Hi People, I am trying to read and use variables in a bat file from an ini files.I am having difficulty reading it and setting it .Any kind of help is appreciated Thanks...