barrystone Posted July 11, 2011 Posted July 11, 2011 Hi Everyone I am trying to run the following batch file but keep getting errors. I know its to do with spaces in long file names batch file as follows:- for /f %%a in (c:\Batch Files and Scripts\ping\c5.txt) do (ping %%a) Where would i put the quotation marks? Any help would be appreciated Thanks Barry Stone
creese Posted July 11, 2011 Posted July 11, 2011 (edited) In place of your first 2 brackets "c:\Batch Files and Scripts\ping\c5.txt" Edited July 11, 2011 by creese
barrystone Posted July 11, 2011 Author Posted July 11, 2011 Hi Creese Tried replacing backet for quotes, still wont run Regards Barry
creese Posted July 11, 2011 Posted July 11, 2011 Is your file extension .cmd or .bat? I also use .cmd You could also put a 'pause' command at the end to see if there are any errors when running. Take it off when it runs okay.
Mcshammer_dj Posted July 11, 2011 Posted July 11, 2011 don't replace the barackets add the inverted commas and keep the brackets
creese Posted July 11, 2011 Posted July 11, 2011 Creese Its .bat Barry I prefer .cmd it's more flexible
Arthur Posted July 11, 2011 Posted July 11, 2011 Try this instead... @echo off cd /d "%~dp0" for /f %%a in (c5.txt) do (ping %%a)
barrystone Posted July 12, 2011 Author Posted July 12, 2011 Authur Thanks Code works OK Regards barry Stone
barrystone Posted July 12, 2011 Author Posted July 12, 2011 Creese Thanks for all your help Regards Barry Stone
jinnantonnixx Posted July 12, 2011 Posted July 12, 2011 9/10* people prefer .cmd * who expressed a preference.
creese Posted July 12, 2011 Posted July 12, 2011 * who expressed a preference. So... I am a one in ten.....
jinnantonnixx Posted July 12, 2011 Posted July 12, 2011 So... I am a one in ten..... No, you're one of nine of ten. Keep up now....
creese Posted July 12, 2011 Posted July 12, 2011 No, you're one of nine of ten. Keep up now.... Artistic licence............... who's ever heard of those lyrics?
jinnantonnixx Posted July 12, 2011 Posted July 12, 2011 (edited) Artistic licence............... who's ever heard of those lyrics? Sore subject. I lost my artistic licence only last week. I failed to stop after taking a montage too fast and was found to be under the influence of Bauhaus. Edited July 12, 2011 by jinnantonnixx
creese Posted July 12, 2011 Posted July 12, 2011 Sore subject. I lost my artistic licence only last week. I failed to stop after taking a montage too fast and was found to be under the influence of Bauhaus. Got mine Leo
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now