Search found 25 matches
- 20 May 2010 16:44
- Forum: DOS Batch Forum
- Topic: User Input
- Replies: 10
- Views: 9524
Re: User Input
Why shouldn't it work?
- 20 May 2010 16:34
- Forum: DOS Batch Forum
- Topic: User Input
- Replies: 10
- Views: 9524
Re: User Input
Use mine code instead if you are having problems with aGerman one's, though his is better than mine, I guess.
- 20 May 2010 16:24
- Forum: DOS Batch Forum
- Topic: User Input
- Replies: 10
- Views: 9524
Re: User Input
echo %input%>test.txt for the first line. echo %input%>>test.txt for the other lines. Example: echo 1>test.txt echo 2>>test.txt The file "test.txt" would be like this: 1 2 If you then would want to add another line to it you would have to put... echo 3>>test.txt ... which would make the f...
- 20 May 2010 11:54
- Forum: DOS Batch Forum
- Topic: set /p timeout
- Replies: 3
- Views: 6643
Re: set /p timeout
Batch is very limited. You can do it with vbs, but I suggest you learning VB.
- 03 May 2010 05:03
- Forum: DOS Batch Forum
- Topic: Read Different Lines Into Different Variable
- Replies: 3
- Views: 5738
Re: Read Different Lines Into Different Variable
Set LINE=0 For /F "delims=" %%L in (settings.ini) do ( Set /A LINE += 1 If "![color=#FF0000]LINE[/color]!" == "4" ( Set STR=%%L Echo.![color=#FF0000]STR[/color]:~7!> %TEMP%.\T1.DAT Findstr /I /B /C:" " %TEMP%.\T1.DAT > nul Del %TEMP%.\T1.DAT ) If /I !STR:~11!...
- 01 May 2010 20:35
- Forum: DOS Batch Forum
- Topic: Issue
- Replies: 2
- Views: 4326
Re: Issue
It's a nice script. A few minor typos - 'Select a option' should be 'Select an option' . I'm still working on why it shows the message twice... maybe it can't handle the input on the first time... I'll get back to you!! Ok. Thank you. And everyone does mistakes. I could tell you why that sentence w...
- 01 May 2010 20:13
- Forum: DOS Batch Forum
- Topic: Change volume or mute it
- Replies: 4
- Views: 8467
Re: Change volume or mute it
phillid wrote:How do you un-mute it with VBS??
Just paste in my previous code in a .vbs script.
- 01 May 2010 18:59
- Forum: DOS Batch Forum
- Topic: Change volume or mute it
- Replies: 4
- Views: 8467
Re: Change volume or mute it
For batch, I don't know.
But you can always make your batch file start a .vbs script that mutes the sound.
.vbs script code:
But you can always make your batch file start a .vbs script that mutes the sound.
.vbs script code:
Code: Select all
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys(chr(173))
- 01 May 2010 18:52
- Forum: DOS Batch Forum
- Topic: Issue
- Replies: 2
- Views: 4326
Issue
Hi, there. I am trying to make a chat in batch language, which I'm almost done. But there's an issue: whenever I run the file, it asks me twice the same choice (choice made by me). Here is the full code: @echo off Cls Set LINE=0 For /F "delims=" %%L in (Settings.ini) do ( Set /A LINE += 1 ...
- 22 Apr 2010 07:20
- Forum: DOS Batch Forum
- Topic: Help
- Replies: 8
- Views: 10562
Re: Help
Hi 1+2=46, If %b%==%0% will always fail, because it expands to if ==counter.bat Because at first %b% is empty, %0 expands to the name of your batch file and the second % will be ignored. I suppose that is not exactly what you want You should use some echo's for debugging, than you can find this typ...
- 21 Apr 2010 11:46
- Forum: DOS Batch Forum
- Topic: Help
- Replies: 8
- Views: 10562
Re: Help
No one?
- 19 Apr 2010 16:23
- Forum: DOS Batch Forum
- Topic: Help
- Replies: 8
- Views: 10562
Re: Help
Okay, I modified the code so it works more perfectly. But when I run the file I get a error. Here it goes the new modified code: @echo off Cls Title Cls Set number=0 Set RS=1000 If not exist "%HomePath%\Desktop\Numbers.txt" ( Echo Numbers between 175 and 200:>>"%HomePath%\Desktop\Numb...
- 19 Apr 2010 06:51
- Forum: DOS Batch Forum
- Topic: Help
- Replies: 8
- Views: 10562
Re: Help
The brackets are not balanced, a closing bracket missing somewhere near the end. Another thing I noticed is that the "If %R%==%RS%" condition will never be true because R will will be 0<R<1000, but never 1000, because "%random% %% 999" will return a random number 0<=number<999. ...
- 18 Apr 2010 10:19
- Forum: DOS Batch Forum
- Topic: Help
- Replies: 8
- Views: 10562
Help
Hi. I am making a batch file where it's purpose will be understood whenever you see the code. Ok, here's the code: @echo off Cls Title Cls Set RS=1000 :Loop Color 0C Ping localhost -n 1 -w 1000 >nul Set /A R=%random%%%999+1 Set /A a=%R% If %a% LSS 50 ( If %a% LSS 25 ( Goto Loop ) If %R%==%RS% ( Goto...
- 10 Apr 2010 07:30
- Forum: DOS Batch Forum
- Topic: Counter
- Replies: 10
- Views: 10592
Re: Counter
Thank you both, ---saster---and jeb, but I already did it with milliseconds. It works almost 100% perfect. Here is the code: @echo off SetLocal EnableDelayedExpansion Cls Color 0C Cls Title Cls Set /A milliseconds=0 Set /A seconds=0 Set /A minutes=5 :Loop Set /A milliseconds=%milliseconds% + 1 If %s...