PDA

View Full Version : BATCH - Strings


ebbings
05-10-2008, 06:12 PM
(For a Windows .bat file)

If I have a file path (eg. C:\Folder\File.ext) as a variable how can I erase everything up to, and including, the last "\"?

I will also need to do the opposite, delete everything after the last "\", but this will be stored as a completely different variable.

To ease confusion...
%1 = C:\Folder\File.ext
%2 = C:\Folder\File.ext

Thanks in advance :thumbsup:

rafiki
05-10-2008, 06:43 PM
So you want to delete a whole folder and all it's contents?

ebbings
05-10-2008, 07:02 PM
So you want to delete a whole folder and all it's contents?

Actually, I'm running a program and sending in a file location, and at one point I need to deal with the file name (File.ext), another point I need the location (C:\Folder\).

ebbings
05-11-2008, 06:03 AM
Found http://users.cybercity.dk/~bse26236/batutil/SUPPORT.HTM#-extract
Problem solved :)