Search found 126 matches
- 14 Jun 2011 17:20
- Forum: DOS Batch Forum
- Topic: String Manipulation examples...
- Replies: 23
- Views: 16797
Re: Still stuck on Call
So I've been seriously messing with the Format function like you advised, and I know what the command is doing, I just don't quite understand what call is doing to make it work. For example, let's say later down the road, I run into a similar need for something like this, what is going to tell me: &...
- 13 Jun 2011 15:37
- Forum: DOS Batch Forum
- Topic: String Manipulation examples...
- Replies: 23
- Views: 16797
Re: String Manipulation examples...
That's awsome guys. Sorry for being such a noob, but it's amazing how one small unknown detail can make everything seem so complicated. Dave, the format function definitely sheds some more light on string manipulation. I've been using substrings, temp files and FOR loops and really over-complicating...
- 13 Jun 2011 13:42
- Forum: DOS Batch Forum
- Topic: If not exist *
- Replies: 8
- Views: 9312
Re: If not exist *
[off]
Code:
IF NOT EXIST C:\MyDirectory\NUL ECHO It's FILE but _NOT_ FOLDER
[/off]
I misread the question... No harm done.
- 13 Jun 2011 12:39
- Forum: DOS Batch Forum
- Topic: String Manipulation examples...
- Replies: 23
- Views: 16797
Re: String Manipulation examples...
CALL SET v=%%map:*%v%-=%% becomes set v=%map:*thevalueofv-=% If you enter set /? in the console, you'll understand. it will replace *thevalueofv- inside variable map with nothing and store this inside v I got it, I use the substring functionality of SET all the time, but completely missed the parag...
- 13 Jun 2011 11:06
- Forum: DOS Batch Forum
- Topic: String Manipulation examples...
- Replies: 23
- Views: 16797
String Manipulation examples...
I apologize if this isn't the right place to ask these types of questions, but I was looking at the example here: m REM ---- Example 1: Translate name of month into two digit number ---- SET v=Mai SET map=Jan-01;Feb-02;Mar-03;Apr-04;Mai-05;Jun-06;Jul-07;Aug-08;Sep-09;Oct-10;Nov-11;Dec-12 CALL SET v=...
- 12 Jun 2011 21:20
- Forum: DOS Batch Forum
- Topic: If not exist *
- Replies: 8
- Views: 9312
Re: If not exist *
This is an old trick, but I needed this exact same thing a couple of weeks ago, so it's fresh in my memory and it works up to Windows7. IF NOT EXIST C:\MyDirectory\NUL ECHO It's NOT THERE On a related note, this was a few weeks ago, but I *think* it had problems with spaces in the path, and quoting ...