Little help with batch programming - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: Little help with batch programming (/showthread.php?tid=93752) Little help with batch programming by Chancer on 02-03-2010 at 06:46 PM
This is my code: code: It does my actions for each file in the bat file's folder. The problem is, one of the arguments I need is the file's name without the extension. For example: %%G is "My text file.txt" and I need to use the command -set name="My text file" . So I changed -set name="%%G" to -set name="%%G:~0,-4%", which should ignore the last 4 characters (dot + extension), but it doesn't work. Does anyone know how to solve this? RE: Little help with batch programming by prashker on 02-03-2010 at 09:32 PM
code:Notice the ~n, it removes the file extenson There should be no need to set it to something else with this code, and I am not even sure setting it inside ()'s will even work...but the %%~n will allow you to do whatever you wanted with the original code. RE: Little help with batch programming by Lou on 02-03-2010 at 09:33 PM
quote:I don't see any anywhere . RE: Little help with batch programming by prashker on 02-03-2010 at 09:36 PM
quote:Odd, my eyes deceived me. Edited post. RE: Little help with batch programming by Chancer on 02-04-2010 at 12:05 AM Just perfect. Thanks. |