Page 1 of 1
whats wrong with this batch file
Posted: 22 Sep 2011 17:37
by C_Hickman
@echo off
echo _ _ _
echo ___| |__ __ _ _ __ __| | | ___ _ __
echo / __| '_ \ / _` | '_ \ / _` | |/ _ \ '__|
echo (__| | | | (_| | | | | (_| | | __/ |
echo \___|_| |_|\__,_|_| |_|\__,_|_|\___|_|
pause
end
im new to batch. the text is a bit off in the typing above. im looking for it to display my ascii art but then pause at the end. if you can also tell me how to make it wait a few seconds before going to the next line
Re: whats wrong with this batch file
Posted: 22 Sep 2011 18:24
by Ed Dyreen
'
Code: Select all
@echo off
echo._ _ _
>nul 2>&1 ping 0.0.0.0
echo.___^| ^|__ __ _ _ __ __^| ^| ^| ___ _ __
>nul 2>&1 ping 0.0.0.0
echo./ __^| '_ \ / _` ^| '_ \ / _` ^| ^|/ _ \ '__^|
>nul 2>&1 ping 0.0.0.0
echo.(__^| ^| ^| ^| (_^| ^| ^| ^| ^| (_^| ^| ^| __/ ^|
>nul 2>&1 ping 0.0.0.0
echo.\___^|_^| ^|_^|\__,_^|_^| ^|_^|\__,_^|_^|\___^|_^|
>nul 2>&1 ping 0.0.0.0
echo.
echo.'^|' is a special command; it takes stdout of previous command,
echo.spawns a new instance and sets stdin accordingly.
echo.echo.This works ^|findstr /lic:"works"
echo.This works |findstr /lic:"works"
pause
exit /b
Re: whats wrong with this batch file
Posted: 22 Sep 2011 18:56
by C_Hickman
it worked, thanks, is there a way to make the delay a little shorter?
Re: whats wrong with this batch file
Posted: 22 Sep 2011 19:26
by Ed Dyreen
'
Code: Select all
@echo off
echo. -n option can be used as multiplier default = 4 x 1000ms = 4000ms
>nul 2>&1 ping /n 1 "0.0.0.0"
ping /?
pause
exit /b
Re: whats wrong with this batch file
Posted: 23 Sep 2011 16:19
by nitt
Ed Dyreen wrote:'
Code: Select all
@echo off
echo. -n option can be used as multiplier default = 4 x 1000ms = 4000ms
>nul 2>&1 ping /n 1 "0.0.0.0"
ping /?
pause
exit /b
What...?
Why not just use the IP address 0 and send the output to nul?
Code: Select all
@echo off
echo Waiting . . .
ping 0 -n 5 > nul
Re: whats wrong with this batch file
Posted: 23 Sep 2011 16:38
by Ed Dyreen
'
Why not just use the IP address 0 and send the output to nul?
Indeed, if you have a network-card AND have the TCP-IP driver running.
In case our bro is less fortune, may want to > both stderr&stdout > nul.
Re: whats wrong with this batch file
Posted: 23 Sep 2011 16:52
by nitt
Ed Dyreen wrote:'
Why not just use the IP address 0 and send the output to nul?
Indeed, if you have a network-card AND have the TCP-IP driver running.
In case our bro is less fortune, may want to > both stderr&stdout > nul.
But we aren't actually pinging an IP. That's why I use 0 instead of like 0.0.0.0, and stuff like that. Every time it pings, it will be unsuccessful. The command doesn't matter, nor what it returns.
And I also don't get how using ">nul 2>&1" like that has anything to do with your network card. It's just syntax...
You'd have to explain, because I don't get what you mean.
Re: whats wrong with this batch file
Posted: 23 Sep 2011 17:03
by Ed Dyreen
'
Disable your network hardware or TCPIP-protocol and see what happens on stderr.
Re: whats wrong with this batch file
Posted: 23 Sep 2011 17:19
by nitt
Ed Dyreen wrote:'
Disable your network hardware or TCPIP-protocol and see what happens on stderr.
I wish you could just tell me.
Re: whats wrong with this batch file
Posted: 23 Sep 2011 18:28
by Ed Dyreen
'
nitt wrote:But we aren't actually pinging an IP. That's why I use 0 instead of like 0.0.0.0, and stuff like that. Every time it pings, it will be unsuccessful. The command doesn't matter, nor what it returns.
And I also don't get how using ">nul 2>&1" like that has anything to do with your network card. It's just syntax...
But we ARE actually pinging an IP, the command does matter, if it didn't we could just use echo. ">nul 2>&1" has nothing to do with your network card. It has to do with the output of the command they operate on. Ping however has everything to do with your network card.
I know of 2 cases where ping will complain, one being that you don't have at least one MAC and the second that the required driver isn't running. ( How would ping be able to ping if it doesn't know how ? ) The reason I direct stderr to null is because I don't wan't to be notified of unhandled errors.
Re: whats wrong with this batch file
Posted: 23 Sep 2011 21:45
by Captcha142
To be more specific in the time delayed can't you
for 500 ms?
Or is this not exactly foolproof/anyone have problems with this?