Search found 40 matches

by jaffamuffin
25 Jun 2009 11:47
Forum: DOS Batch Forum
Topic: HELP with "FOR LOOP" inside another
Replies: 12
Views: 17858

Yes. I often do that, but if you perform a SET /A on a number that starts with 0 (zero) the interpreter interprets it an an Octal number, and could give 'weird' results, to saythe least My way means it doesn't matter but doing it by adding would mean the out put number would be padded, even if the i...
by jaffamuffin
25 Jun 2009 07:00
Forum: DOS Batch Forum
Topic: FOR not loading files with extremely long line
Replies: 3
Views: 7231

Yes. Probably some kind of limit.

There's probably another way you can do this, what is it exactly that you are trying to do?
by jaffamuffin
25 Jun 2009 06:53
Forum: DOS Batch Forum
Topic: Monthly Download of Files
Replies: 3
Views: 7075

I think this might depend on regional settings to make things quick and easy. On my XP box: C:\>echo %date% 25/06/2009 on my win2k box Z:\>echo %date% Thu 25/06/2009 Just extract the name from the output. Other wise some kind of math calcualtion is going to have to be performed. Or just have a separ...
by jaffamuffin
24 Jun 2009 17:18
Forum: DOS Batch Forum
Topic: HELP with "FOR LOOP" inside another
Replies: 12
Views: 17858

here's my attempt. Could be cleaned up a lot and I see someone has now posted a similar looking solution: @echo off SETLOCAL ENABLEDELAYEDEXPANSION :fixtimes SET currentline=0 for /F "tokens=1,2,3,4,5* delims=;: " %%A IN (in.txt) DO ( IF "%%A"=="time" ( ...
by jaffamuffin
04 May 2009 10:17
Forum: DOS Batch Forum
Topic: Image Dimension ??
Replies: 5
Views: 12905

ImageMagick is a fantastic command line program and will give you thousands of operations possible on images. But "identify image.jpg" should out put the required info, just use a for loop to extract the required values. Also, XP has built in functionally (like how explorer can give you de...
by jaffamuffin
19 Feb 2009 04:01
Forum: DOS Batch Forum
Topic: Batch automated text entry.
Replies: 3
Views: 7299

not using batch. You would need some kind of gui tool. Unless you can pass the contents of the form as a parameter in the same way the search term is passed to google as a parameter. There are tools to copy text to the clipboard in a batch file so you could get the text 'out' of the batch easily eno...
by jaffamuffin
18 Feb 2009 17:13
Forum: DOS Batch Forum
Topic: Batch automated text entry.
Replies: 3
Views: 7299

open the web browser with this address :

http://www.google.com/search?q=test

and replace test with whatever you want to search for...
by jaffamuffin
18 Feb 2009 00:13
Forum: DOS Batch Forum
Topic: Replace space with "_" in file names
Replies: 3
Views: 11112

by jaffamuffin
17 Feb 2009 18:57
Forum: DOS Batch Forum
Topic: batch on-screen and logged to textfile?
Replies: 4
Views: 8925

mm. That may work, but don't have time to uderstand exactly what it doing.. what I have done in the past is to get a copy of tail.exe you can get this from the gnu utils / unix tools and then run your script with myscript.bat > log.txt and then in another window type tail -f log.txt and it will just...
by jaffamuffin
17 Feb 2009 15:40
Forum: DOS Batch Forum
Topic: Need help on DIR command
Replies: 1
Views: 5219

Use the expansion shortcuts.

if %1 is c:\drivers\audio

then %~pn1 is \drivers\audio
and %~n1 is \audio\

etc
by jaffamuffin
05 Feb 2009 13:58
Forum: DOS Batch Forum
Topic: Make your own cmd prompt Commands
Replies: 2
Views: 7833

I prefer to make a specific scripts directory . e.g. C:\scripts and add that to my %PATH% environment variable.

this way it keeps the system dirs tidy, and i know what i'm dealing with just by looking in there.
by jaffamuffin
05 May 2008 04:00
Forum: DOS Batch Forum
Topic: passing and gaining parameters to MS DOS Batch file
Replies: 8
Views: 17658

Interesting, I definately need to look at this.

I'm trying to write a batch file that will accept either, 1 image, more than one image (upto around a 1000) or a folder, dropped onto the icon.

Will post up some code later.

Cheers
by jaffamuffin
03 May 2008 15:49
Forum: DOS Batch Forum
Topic: passing and gaining parameters to MS DOS Batch file
Replies: 8
Views: 17658

Is there any limit on the number of files (images) that could be recorded into variables like this? In my tests I have found dropping about 31/32 files onto a batch and reading them in to array style like that is the limit...
by jaffamuffin
08 Apr 2008 15:43
Forum: DOS Batch Forum
Topic: Incremental count in a FOR loop
Replies: 4
Views: 11746

Nice tip. Any way to avoid SETLOCAL ENABLEDELAYEDEXPANSION is good :)
by jaffamuffin
07 Apr 2008 18:07
Forum: DOS Batch Forum
Topic: What is dropped on this batch: file or folder? (a solution)
Replies: 2
Views: 8044

Code: Select all

@ECHO off
SETLOCAL
SET attributes=%~a1
SET dirAttrib=%attributes:~0,1%
IF %dirAttrib%==d ( ECHO DIR ) ELSE ( ECHO FILE )
PAUSE

Try this.