Search found 20 matches

by Bob D
17 Dec 2012 10:26
Forum: DOS Batch Forum
Topic: get path and filename from a variable
Replies: 3
Views: 4241

Re: get path and filename from a variable

I felt embarrassed asking the original question in this thread but I haven't hit a keyboard in a long time and just could not see the easy way (which I knew would exist) to the answer. I'm just getting back into it all now. Thanks again. :D
by Bob D
13 Dec 2012 11:52
Forum: DOS Batch Forum
Topic: get path and filename from a variable
Replies: 3
Views: 4241

Re: get path and filename from a variable

That worked well. Thanks for that.
by Bob D
13 Dec 2012 04:39
Forum: DOS Batch Forum
Topic: get path and filename from a variable
Replies: 3
Views: 4241

get path and filename from a variable

I am so out of touch that I can't even think where to start plus I was never great at this. I will have a fully qualified file name (drive, path & filename) passed to my batch file as %1. The batch file and its parms will be started from a shortcut. I need to split the string into the path and f...
by Bob D
19 Sep 2011 17:39
Forum: DOS Batch Forum
Topic: Batch with files as input
Replies: 8
Views: 8349

Re: Batch with files as input

First of all, why the freaking pickle are you writing out the full path of a file that's already in your system32 folder?!?!?!?!?! And second of all, I don't even have bootlog/pcinfo.bat on my PC! So I don't even see your point because any newbie can't test it! Also, why "/realtime"? It u...
by Bob D
19 Sep 2011 16:27
Forum: DOS Batch Forum
Topic: Batch with files as input
Replies: 8
Views: 8349

Re: Batch with files as input

The START command can execute commands external to the current window. It can also name files which will be processed by a file extension association. You can execute them and wait for them to finish or simply launch them and forget them. Look at START /? I used the following in a shortcut with the ...
by Bob D
13 Sep 2011 17:58
Forum: DOS Batch Forum
Topic: Epic-ish idea!
Replies: 5
Views: 6768

Re: Epic-ish idea!

first of all the help command dosent show examples nor explain the commands good enough ( for me atleast ) I am recently new at this again after a long period doing other and I am finding difficulty with syntax and capability of the commands and the changes that have happened since DOS. One change ...
by Bob D
13 Sep 2011 17:19
Forum: DOS Batch Forum
Topic: Epic-ish idea!
Replies: 5
Views: 6768

Re: Epic-ish idea!

Or you can just use "command /?". It's a good source of info but it falls down in that it is incomplete. Example: FINDSTR /? does not indicate that you can use Errorlevel to check for completion. A wiki could start with the basic Command /? and then could be adjusted by the community for ...
by Bob D
13 Sep 2011 17:12
Forum: DOS Batch Forum
Topic: for /f and findstr help please
Replies: 4
Views: 5380

Re: for /f and findstr help please

use FIND to find the line(s) in question, push the output to a file, read the file into a variable, search the variable for the target. find /i "wanted string" fileA > tempfile.txt set /p var1 = < tempfile.txt the above may fall over if there is more than one line in the original file that...
by Bob D
13 Sep 2011 16:44
Forum: DOS Batch Forum
Topic: Finding Characters Within a Variable [solved]
Replies: 4
Views: 4584

Re: Finding Characters Within a Variable [solved]

In this case it will work because your target is at a fixed location but I like Dave Benham's solution better. It is more robust in that if the target is not where you thought it was then it still works.
by Bob D
13 Sep 2011 16:26
Forum: DOS Batch Forum
Topic: Need help deleting files within a folder.
Replies: 8
Views: 7496

Re: Need help deleting files within a folder.

You could use the ATTRIB command to set all attributes to +A (or anything else that is convenient) then set the two files to something else (+R) and then do a delete based on not R

Code: Select all

attrib -R -A -S -H -I *.* > nul
attrib +R fileA > nul
attrib +R fileB > nul
del /q /a-r
by Bob D
13 Sep 2011 14:36
Forum: DOS Batch Forum
Topic: Need help deleting files within a folder.
Replies: 8
Views: 7496

Re: Need help deleting files within a folder.

You appear to be trying to exclude files by using the - (not). The - is to negate the attribute(s). to see all files but no folders in a folder dir /a:-d or this works too dir /a-d shows no directories and all text files beginning with s. dir /a-d s*.txt I can't see how to do an exclude based on fil...
by Bob D
13 Sep 2011 13:59
Forum: DOS Batch Forum
Topic: content check
Replies: 5
Views: 5439

Re: content check

FINDSTR does set the ERRORLEVEL ERRORLEVEL = 0 if string is found and 1 if string is not found. One of the things I find frustrating is there seems to be no fully accurate command reference. Is there any such thing I looked for info on Findstr setting Errorlevel but could not find it. It seems obvi...
by Bob D
13 Sep 2011 05:39
Forum: DOS Batch Forum
Topic: Need help deleting files within a folder.
Replies: 8
Views: 7496

Re: Need help deleting files within a folder.

You can use the same command syntax in the DIR command to see a list of files that qualify for your criteria.
You could also turn off the /Q for debugging. You didn't say what your problem was.
by Bob D
13 Sep 2011 05:08
Forum: DOS Batch Forum
Topic: content check
Replies: 5
Views: 5439

Re: content check

Here is a useful command refernce http://www.microsoft.com/download/en/confirmation.aspx?id=2632 The Findstr does not appear to set errorlevel. You could try using the /m to only output the filename if the string exists within the file. You could put that filename into another file and read back the...