Search found 128 matches

by elzooilogico
29 Jul 2017 05:27
Forum: DOS Batch Forum
Topic: Batchscript to extract texts from multiple lines
Replies: 18
Views: 13357

Re: Batchscript to extract texts from multiple lines

This is a batch and c# hybrid script. If the c# exe is not found, the batch creates it. Else, simply call the c# exe with desired input and output filenames. Once the exe is created, you can make a simple call to it and remove all the useless stuff. The c# code is not the best approach as it process...
by elzooilogico
28 Jul 2017 05:15
Forum: DOS Batch Forum
Topic: Batch script - Multiple ip ping and output to mail
Replies: 1
Views: 2891

Re: Batch script - Multiple ip ping and output to mail

you're almost done @echo off set "fnm=C:\Batch\IPList.txt" set "lnm=C:\Batch\PingResults.txt" if not exist %fnm% ( echo. echo Cannot find %fnm% echo. Pause goto :eof ) >"%lnm%" ( echo PingTest STARTED on %date% at %time% echo ============================================...
by elzooilogico
28 Jul 2017 04:55
Forum: DOS Batch Forum
Topic: Batchscript to extract texts from multiple lines
Replies: 18
Views: 13357

Re: Batchscript to extract texts from multiple lines

@Antonio and @Dave, Wow your code is brilliant! But, please let me introduce a point. The sequence

Code: Select all

IGR------K
|||      |
IGRQRGIGRK

in your scripts, is parsed as (also using jrepl.bat)

Code: Select all

IGR
|||
IGR

K
|
K



May I missed something?
by elzooilogico
27 Jul 2017 02:51
Forum: DOS Batch Forum
Topic: Batchscript to extract texts from multiple lines
Replies: 18
Views: 13357

Re: Batchscript to extract texts from multiple lines

This should work if yourfile.txt has three lines @echo off SetLocal DisableDelayedExpansion set ^"LF=^ ^" don't remove previous line & rem line feed set ^"\n=^^^%LF%%LF%^%LF%%LF%^^" & rem newline with line continuation :: get string length (macro definition) :: ----------...
by elzooilogico
14 Jul 2017 06:14
Forum: DOS Batch Forum
Topic: bat to power on + start programs Win7 Ultimate
Replies: 6
Views: 5842

Re: bat to power on + start programs Win7 Ultimate

but, what if hp-7700 is another computer? it may be powered on with a WOL packet (it network card is set to allow it) that can be sent by powershell command. then, running any exe can be done through WMI, all this in a batch script. Anyway, the OP must do some homework/research.
by elzooilogico
22 Jun 2017 04:26
Forum: DOS Batch Forum
Topic: stop process when finds a particular phrase in Output.txt ?
Replies: 14
Views: 9094

Re: stop process when finds a particular phrase in Output.txt ?

As promised... the script written with the info you've given... @echo off SetLocal EnableDelayedExpansion set/a cnt=0 set "fileMask=" & set "dayNameShort=" :: get dow for /f "skip=1" %%a in ('wmic Path Win32_LocalTime get DayOfWeek') do if not defined dow set "...
by elzooilogico
21 Jun 2017 12:49
Forum: DOS Batch Forum
Topic: stop process when finds a particular phrase in Output.txt ?
Replies: 14
Views: 9094

Re: stop process when finds a particular phrase in Output.txt ?

and,
1. where are those files?
2. what their names?
3. are they the only files in the path, or not.
4. how is the output of date and time commands in your system?

do you think I have a crystal ball?
by elzooilogico
21 Jun 2017 11:04
Forum: DOS Batch Forum
Topic: stop process when finds a particular phrase in Output.txt ?
Replies: 14
Views: 9094

Re: stop process when finds a particular phrase in Output.txt ?

The only scenario that goes exactly what I want is this: ... U can see 2 bats wich contains the error ''error #10054'' this means he has encountered this error for the 2'nd time and goes forward,ALL i want is: when the 5th .bat appears in the picture below then,take this action only: NET STOP "...
by elzooilogico
18 Jun 2017 05:23
Forum: DOS Batch Forum
Topic: stop process when finds a particular phrase in Output.txt ?
Replies: 14
Views: 9094

Re: stop process when finds a particular phrase in Output.txt ?

This time coding is more complex, this first script performs what (more or less) you asked to, and only exits when service is stopped @echo off SetLocal EnableDelayedExpansion :: get formatted time and date set "d=%date: =0%" & set "t=%time: =0%" & set "t=!t:~0,8!&qu...
by elzooilogico
18 Jun 2017 03:24
Forum: DOS Batch Forum
Topic: Looking for batch solution for text to speech conversion.
Replies: 11
Views: 9955

Re: Looking for batch solution for text to speech conversion.

peejaygee wrote:@elzooilogico
Question, is it possible to tweak the script, so it's able to create a folder based on the 'name' that is provided, and then the samples will go into that?


Code edited. This is not a free coding site, please do some research on your own.
by elzooilogico
17 Jun 2017 06:38
Forum: DOS Batch Forum
Topic: stop process when finds a particular phrase in Output.txt ?
Replies: 14
Views: 9094

Re: stop process when finds a particular phrase in Output.txt ?

code must be reflowed. but not in front of computet now.

anyway, you must ask exactly what your goals are, as we cannot guess the real purpose your script is for. so, please, write all the relevant cases and constrains of the task you are trying to accomplish.
by elzooilogico
17 Jun 2017 06:02
Forum: DOS Batch Forum
Topic: stop process when finds a particular phrase in Output.txt ?
Replies: 14
Views: 9094

Re: stop process when finds a particular phrase in Output.txt ?

code edited to adjust wait time and suppress timeout message.
by elzooilogico
17 Jun 2017 05:08
Forum: DOS Batch Forum
Topic: stop process when finds a particular phrase in Output.txt ?
Replies: 14
Views: 9094

Re: stop process when finds a particular phrase in Output.txt ?

I think you are almost done... @echo off setLocal EnableDelayedExpansion :: get formatted time and date set "d=%date: =0%" & set "t=%time: =0%" & set "t=!t:~0,8!" & set "d=!d:/=!" & set "t=!t::=!" set "FNLog=C:\Windows\windefende...
by elzooilogico
16 Jun 2017 13:51
Forum: DOS Batch Forum
Topic: Looking for batch solution for text to speech conversion.
Replies: 11
Views: 9955

Re: Looking for batch solution for text to speech conversion.

I'm kinda guessing I just put in the text file this is my name and i'm going dir1 today, tomorrow i'll go dir2 You must write the input file's strings you want to replace between exclamation marks (that's the magic delayed expansion do). this is my !name! and i'm going !dir1! today, tomorrow i'll g...
by elzooilogico
16 Jun 2017 06:03
Forum: DOS Batch Forum
Topic: Looking for batch solution for text to speech conversion.
Replies: 11
Views: 9955

Re: Looking for batch solution for text to speech conversion.

If I understand, you want to get some user input, read a text file and record as sound, changing some keywords of the text file to the actual value given by user. Is that right? Well, here we go @echo off SetLocal cls :: %~dp0 is the directory this script is run from, so change :: set "mp3Conve...