Search found 15 matches

by Mado91
08 Apr 2020 00:13
Forum: DOS Batch Forum
Topic: edit lines in FIND comand
Replies: 2
Views: 3355

Re: edit lines in FIND comand

Thank a lot! It worked fine.
I tried the for comand too before asking but I was misswriting the syntax, basically because of the use of apex ^.
Thanks again
by Mado91
07 Apr 2020 15:08
Forum: DOS Batch Forum
Topic: edit lines in FIND comand
Replies: 2
Views: 3355

edit lines in FIND comand

Hi programmers, I'm facing the following task: I have the file "c:\folder\a.txt" with the following content: a b a b c So I use the following batch: find "a" < c:\folder\a.txt >> c:\folder\b.txt and I obtain the c:\folder\b.txt with the following content: a a Now, what if I want to add a string afte...
by Mado91
12 Apr 2019 12:33
Forum: DOS Batch Forum
Topic: Taskkill comand error
Replies: 2
Views: 2963

Re: Taskkill comand error

...Thanks
by Mado91
12 Apr 2019 10:29
Forum: DOS Batch Forum
Topic: Taskkill comand error
Replies: 2
Views: 2963

Taskkill comand error

Hi programmers, I encountered an issue with taskkill command: I first wrote the following code: start notepad.exe timeout 5 taskkill /IM notepad.exe pause it worked properly, so I tried: start chrome.exe timeout 5 taskkill /IM chrome.exe pause then the error message: "ERROR: it's impossible to termi...
by Mado91
10 Apr 2019 10:39
Forum: DOS Batch Forum
Topic: set %RANDOM% for timeout command
Replies: 7
Views: 9268

Re: set %RANDOM% for timeout command

This suits perfectly! Thanks a lot :)
by Mado91
09 Apr 2019 23:01
Forum: DOS Batch Forum
Topic: set %RANDOM% for timeout command
Replies: 7
Views: 9268

Re: set %RANDOM% for timeout command

Thanks evefrybody for the tips :) . Still I encountered anoter problem! I wrote the following working code: :labely start notepad.exe SET /A watch=%RANDOM% %% 2400 timeout %watch% goto labely Then I need to insert it in a bigger program, here the full example code: @ECHO OFF title BulBot color 70 :m...
by Mado91
08 Apr 2019 22:42
Forum: DOS Batch Forum
Topic: set %RANDOM% for timeout command
Replies: 7
Views: 9268

Re: set %RANDOM% for timeout command

Of course! Thanks a lot! :lol: ...........................................________ ....................................,.-'"...................``~., .............................,.-"..................................."-., .........................,/...............................................":, ...
by Mado91
08 Apr 2019 10:22
Forum: DOS Batch Forum
Topic: set %RANDOM% for timeout command
Replies: 7
Views: 9268

set %RANDOM% for timeout command

Goodevening programmers, here I have a trouble with a .bat file I'm working on: I want do make an action (for example: start notepad.exe) over and over with a "random" timeout with the following code: :label start notepad.exe timeout %RANDOM% goto label Now I need to "set" the random number, for exa...
by Mado91
18 Mar 2019 14:59
Forum: DOS Batch Forum
Topic: Modify a .txt file with a batch file (without a text editor)
Replies: 3
Views: 5219

Re: Modify a .txt file with a batch file (without a text editor)

Hi, thanks a lot for the precious answer. I searched infos about FOR and SET comands, still I'm not sure how it can be helpfull for edit a .txt :cry: some practical example would be very usefull to me, but I haven't found one, just more ore less theorical explanatioms I'm not "ready" to understand p...
by Mado91
18 Mar 2019 11:42
Forum: DOS Batch Forum
Topic: Modify a .txt file with a batch file (without a text editor)
Replies: 3
Views: 5219

Modify a .txt file with a batch file (without a text editor)

Hi programmers, here's my today goal: I would really be amused to learn how to edit a .txt file just using batch comands without using a text editor. Easy things just like the following steps: 1) open file.txt 2) replace all the letters "a" with the letter "b" 3) save file.txt 4) close file.txt Than...
by Mado91
17 Mar 2019 12:05
Forum: DOS Batch Forum
Topic: Problem creating a batch file with a mother-batch file
Replies: 2
Views: 3100

Problem creating a batch file with a mother-batch file

Hi programmers, I encountered the following problem: I wanted to create a batch file able to create another batch file, here's the code: echo @ECHO OFF >> BulBot.bat echo title BulBot >> BulBot.bat echo color 70 >> BulBot.bat echo :masterlabel >> BulBot.bat echo set /P input= >> BulBot.bat echo IF %...
by Mado91
17 Mar 2019 11:56
Forum: DOS Batch Forum
Topic: BATCH interactions with opened .exe
Replies: 5
Views: 4897

Re: BATCH interactions with opened .exe

Got it, thanks everyone!
anyway, even if I really, really, really wanted to do it, I wouldn't know how :lol:
by Mado91
17 Mar 2019 04:09
Forum: DOS Batch Forum
Topic: BATCH interactions with opened .exe
Replies: 5
Views: 4897

Re: BATCH interactions with opened .exe

Hi, thanks for the answer. So now I wonder... what level of "freedom" can I have to interact with non-bat files? For example, I know that DOS can create and edit txt files, or even edit a previously existing file. I made experiments using the following code: set /P input= echo %input% >> output.txt ...
by Mado91
16 Mar 2019 08:15
Forum: DOS Batch Forum
Topic: BATCH interactions with opened .exe
Replies: 5
Views: 4897

BATCH interactions with opened .exe

Hi everyone, I'm a self-taught (nice way to mean "noob") programmer and that's my first approach to DOS comands and .bat files. I've already written a couple of .bat that can do basic things with inputs, so now I wonder: is it possible to make a .bat program opens an .exe and interact with it? For e...