balanel Posted December 29, 2011 Share Posted December 29, 2011 (edited) hihow can i run a batch that ends with "_1" or a batch that contains "_" for example from another batch fileabcd_1.bat or abcd_efgh.bat, abcd and efgh can be anything10x Edited December 29, 2011 by balanel Link to comment Share on other sites More sharing options...
iamtheky Posted December 29, 2011 Share Posted December 29, 2011 (edited) to run "abcd_efgh.bat", "abcd_1.bat" would consist of:@echo off"abcd_efgh.bat"**That seems fairly straight forward, works without quotes, what error were you receiving that leads you to believe the underscores are the issue? Edited December 29, 2011 by iamtheky Link to comment Share on other sites More sharing options...
Yzöwl Posted December 29, 2011 Share Posted December 29, 2011 @FOR /F "TOKENS=*" %%# IN ('DIR/B/A-D *_*.BAT') DO @(CALL "%%#") Link to comment Share on other sites More sharing options...
iamtheky Posted December 29, 2011 Share Posted December 29, 2011 Awesome Yzowl, batches are your biatch i learn something everytime you post. Link to comment Share on other sites More sharing options...
Yzöwl Posted December 29, 2011 Share Posted December 29, 2011 Please remember that there is a more simple method too:@FOR %%# IN (*_*.BAT) DO @(CALL "%%#")I posted the former because as a for loop 'command' rather than 'file set' you have more control over the variables, (and they're easier to maintain), simply by changing the contents of the loop or the tokens/delimiters rather than parsing through resulting variables with extra code later. Link to comment Share on other sites More sharing options...
balanel Posted January 4, 2012 Author Share Posted January 4, 2012 thanks for help, works ok Link to comment Share on other sites More sharing options...
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