whats wrong with this batch file
Moderator: DosItHelp
whats wrong with this batch file
@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
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
'
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
it worked, thanks, is there a way to make the delay a little shorter?
Re: whats wrong with this batch file
'
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
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
'
In case our bro is less fortune, may want to > both stderr&stdout > nul.
Indeed, if you have a network-card AND have the TCP-IP driver running.Why not just use the IP address 0 and send the output to nul?
In case our bro is less fortune, may want to > both stderr&stdout > nul.
Re: whats wrong with this batch file
Ed Dyreen wrote:'Indeed, if you have a network-card AND have the TCP-IP driver running.Why not just use the IP address 0 and send the output to nul?
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
'
Disable your network hardware or TCPIP-protocol and see what happens on stderr.
Disable your network hardware or TCPIP-protocol and see what happens on stderr.
Last edited by Ed Dyreen on 23 Sep 2011 18:28, edited 5 times in total.
Re: whats wrong with this batch file
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
'
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.
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.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...
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.
-
- Posts: 13
- Joined: 18 Sep 2011 23:35
Re: whats wrong with this batch file
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?
Code: Select all
ping 192.168.1.1 -n 1 -t 500>NUL
for 500 ms?
Or is this not exactly foolproof/anyone have problems with this?