Search found 14 matches
- 20 Apr 2013 01:14
- Forum: DOS Batch Forum
- Topic: Several errorlevels in same script?
- Replies: 2
- Views: 3675
Re: Several errorlevels in same script?
Hi, Thanks for your help, i just noticed now that my errorlevel does change with each command like i thought it didn't. It was because i had mixed up some directories previous in the script. Your script does indeed look like it might do what i wanted it to do too - With some editing to what it gives...
- 19 Apr 2013 14:59
- Forum: DOS Batch Forum
- Topic: Several errorlevels in same script?
- Replies: 2
- Views: 3675
Several errorlevels in same script?
Hi, I'm wondering if it's possible to have several %errorlevel% in the same script, or rather that %errorlevel% is overwritten by a new %errorlevel% as the script progresses? I have a script which in 3 stages will search a text that's piped into "find" for 3 different specific strings. Thi...
- 27 Feb 2013 16:20
- Forum: DOS Batch Forum
- Topic: Batch scripts queueing loop script
- Replies: 21
- Views: 18160
Re: Batch scripts queueing loop script
This one works too, thank you very much for all the help.
Problem solved then, i guess
Problem solved then, i guess

- 27 Feb 2013 15:28
- Forum: DOS Batch Forum
- Topic: Batch scripts queueing loop script
- Replies: 21
- Views: 18160
Re: Batch scripts queueing loop script
This is the final code i ended up with. I just tried it both with none of the processes already running, and by running the batch script 3 times, making the 3rd one queue itself like it was supposed to. It's working wonderfully. Thanks for all the help. :queue for /f %%a in ('tasklist ^|find /i &quo...
- 27 Feb 2013 15:13
- Forum: DOS Batch Forum
- Topic: Batch scripts queueing loop script
- Replies: 21
- Views: 18160
Re: Batch scripts queueing loop script
foxidrive wrote:You have a syntax error to begin with.
It was the do() inside a do() command which i put it, wasn't it?
- 27 Feb 2013 15:06
- Forum: DOS Batch Forum
- Topic: Batch scripts queueing loop script
- Replies: 21
- Views: 18160
Re: Batch scripts queueing loop script
Yes, i change the process.exe to the name of the actual process in question As for the code, this is the start of it @echo OFF cd /D C:\downloads\ timeout 5 set fn=%~n1 echo file: %~nx1 set fne=%~nx1 :queue for /f %%a in ('tasklist ^|find /i "process.exe" ^|find /c /v "" ') do ( ...
- 27 Feb 2013 14:45
- Forum: DOS Batch Forum
- Topic: Batch scripts queueing loop script
- Replies: 21
- Views: 18160
Re: Batch scripts queueing loop script
I just tried the code, however it just keeps looping again and again even though there are none of the specific process running for any user, nor for the system. The (modified) code i tried was ##some unrelevant script over here :queue for /f %%a in ('tasklist ^|find /i "process.exe" ^|fin...
- 27 Feb 2013 14:32
- Forum: DOS Batch Forum
- Topic: Batch scripts queueing loop script
- Replies: 21
- Views: 18160
Re: Batch scripts queueing loop script
I always used the timeout command for pauses. i.e. "timeout 60" for a 60 second timeout, so i never knew about the ping command. The timeout command even counts down in the commandline window. Thanks for the help. I will try inputting the codes into the script now, and see how it goes. I w...
- 27 Feb 2013 09:11
- Forum: DOS Batch Forum
- Topic: Batch scripts queueing loop script
- Replies: 21
- Views: 18160
Re: Batch scripts queueing loop script
Yes. See my edited post with the code above. You might try saying 'Thank you' next time when someone offers free help, and if the code doesn't work then you can say so. I haven't gotten around to trying to code yet, but thank you to both you and Ed Dyreen who have offered help Edit to avoid doublep...
- 27 Feb 2013 08:47
- Forum: DOS Batch Forum
- Topic: Batch scripts queueing loop script
- Replies: 21
- Views: 18160
Re: Batch scripts queueing loop script
The script i already have is used for processing files and give an output file. Files are dropped onto the .bat file. It then sets the filename, checks if the output file for it already exists, and if the file doesn't already exist it then moves on to start the process which will process the file an...
- 27 Feb 2013 06:30
- Forum: DOS Batch Forum
- Topic: Batch scripts queueing loop script
- Replies: 21
- Views: 18160
Re: Batch scripts queueing loop script
Yes, process.exe is unique, but there can be run many simultaneous instances of it (many process.exe at the same time, with the same process name), which is what i'm trying to queue with this script, since it takes alot of processing power, i'd like it to only be able to run 2 instances of the proce...
- 27 Feb 2013 04:29
- Forum: DOS Batch Forum
- Topic: Batch scripts queueing loop script
- Replies: 21
- Views: 18160
Batch scripts queueing loop script
Hi, I'm wondering if it's possible to make a batch script detect if and how many of a process instances are already running, and if too many are already running, make the upcoming instances of the process timeout and try again with time intervals untill few enough of the instances are running to let...
- 30 Oct 2012 07:55
- Forum: DOS Batch Forum
- Topic: Make line breaks in a ouput .txt file
- Replies: 3
- Views: 4425
Re: Make line breaks in a ouput .txt file
Boombox wrote:.
Just in case all you want to do is ADD a line...Code: Select all
@echo off
echo Hello World>file.txt
echo I am currently asking a question>>file.txt
> Create file.
>> Append to file on next line.
Yes, thank you, that's exactly what i was on the lookout for.
- 30 Oct 2012 06:38
- Forum: DOS Batch Forum
- Topic: Make line breaks in a ouput .txt file
- Replies: 3
- Views: 4425
Make line breaks in a ouput .txt file
0 down vote favorite Hi, I'm wondering if i could have some help with making line breaks in an ouput .txt file made using a batch file. Here's the beginning of my script, so you might see better what i mean: @echo OFF type NUL > newfile.txt ECHO Hello, world. I am currently asking a question. > newf...