Search found 13 matches

by Captcha142
28 Feb 2012 23:17
Forum: DOS Batch Forum
Topic: processing string from file
Replies: 5
Views: 4619

Re: processing string from file

One last tangential question:
How do you make "for" repeat until there are no more delimiters, ie.

Code: Select all

for /f "tokens=1, *. delims=;" %%a in ("%inputFile%") do (
...
)


when *. is the repeating anychar (to cycle until no delimiters left)
by Captcha142
28 Feb 2012 22:39
Forum: DOS Batch Forum
Topic: processing string from file
Replies: 5
Views: 4619

Re: processing string from file

Yes! Thank you!

However, why did you put a=%%a; in quotes?
Is there reason for this syntax?
(for is the my least understood of cmd commands, so link to reference isn't discouraged . . .)
by Captcha142
28 Feb 2012 22:17
Forum: DOS Batch Forum
Topic: small Problem [solved]
Replies: 3
Views: 3710

Re: small Problem

To sucessfully make batch files from batch files, you need to employ the escape character ^ instead of echo.START /max %ComSpec% /c "%Temp%\md5.exe" use echo.START /max ^%%ComSpec^%% /c ^"^%%Temp^%%\md5.exe^" (percent signs like to be odd in batch) EDIT: just saw part about ping ...
by Captcha142
28 Feb 2012 22:11
Forum: DOS Batch Forum
Topic: processing string from file
Replies: 5
Views: 4619

processing string from file

I have been working (per request of a challenge) on a batch script to process a text file opened with it, and eventually want to renotate the .txt into batch However, simply prep-ing the file for processing is throwing problems I have two files comp.bat and text.txt code.bat @echo off set /p inputFi...
by Captcha142
30 Sep 2011 18:18
Forum: DOS Batch Forum
Topic: How to invoke keystrokes | Macro
Replies: 1
Views: 2442

How to invoke keystrokes | Macro

Is there a way to invoke keystrokes/mouse clicks in batch. I have been trying forever to make a macro/ auto keystrokes.

NOTE: must be able to output keystrokes to outside programs/prompts.
by Captcha142
23 Sep 2011 21:45
Forum: DOS Batch Forum
Topic: whats wrong with this batch file
Replies: 10
Views: 9025

Re: whats wrong with this batch file

To be more specific in the time delayed can't you

Code: Select all

ping 192.168.1.1 -n 1 -t 500>NUL


for 500 ms?

Or is this not exactly foolproof/anyone have problems with this?
by Captcha142
20 Sep 2011 21:27
Forum: DOS Batch Forum
Topic: Help With JukeBox
Replies: 8
Views: 7455

Re: Help With JukeBox

I have a simple "chimes.bat" in my archive;
try

Code: Select all

mplay32 /play /close c:\windows\media\flourish.mid

To play the flourish track from XP.
If

Code: Select all

mplay32 /play /close c:\JukeBox\%choice%.wav

doesn't work, try changing the file extensions... mplay doesn't play many file types.
by Captcha142
20 Sep 2011 17:00
Forum: DOS Batch Forum
Topic: Batch with files as input
Replies: 8
Views: 7411

Re: Batch with files as input

one last question with for /f:
I read the thread, and is there a way to use a variable as a delimiter,

and can you use everything after the delimiter?
by Captcha142
19 Sep 2011 18:00
Forum: DOS Batch Forum
Topic: Help with set /a command
Replies: 15
Views: 17609

Re: Help with set /a command

The set /a command can also be used when creating loops. eg. To write a text file counting from 1 to 100 named numbers write: @echo off set x=1 :start if NOT "%x%"=="101" ( echo %x%>>numbers.txt set /a x=%x%+1 goto start ) echo Done! pause NOTE: the variable can't equal zero, thu...
by Captcha142
19 Sep 2011 17:54
Forum: DOS Batch Forum
Topic: Email
Replies: 9
Views: 11441

Re: Email

Isn't this possible via telnet??
by Captcha142
19 Sep 2011 17:41
Forum: DOS Batch Forum
Topic: Batch with files as input
Replies: 8
Views: 7411

Re: Batch with files as input

Thank you lots nitt, but in order for all commands to work, I need to be able to remove the extension from the filename.

Is this possible?


the batch currently reads:

Code: Select all

@echo off
javac %1
REM this compiles .java file
java %1
REM for command to work I need to lose .java extension
pause
by Captcha142
19 Sep 2011 15:55
Forum: DOS Batch Forum
Topic: Can a batch program be used to create a recovery utility?
Replies: 3
Views: 3756

Re: Can a batch program be used to create a recovery utility

What do you mean a recovery program?
Do you want to backup and potentially replace files? Or reset files to a default?
What are you looking for?
by Captcha142
18 Sep 2011 23:47
Forum: DOS Batch Forum
Topic: Batch with files as input
Replies: 8
Views: 7411

Batch with files as input

Is there a way to write a batch file and then associate the file type with the batch file so that the batch file runs commands with the selected file name I know how to associate file types, it's the batch file part I don't understand. The goal of this is to run the following commands: @echo off jav...