Hi,
Am trying to figure out how to make a batch file that will give a prompt to enter a PC name or printer and and perform the ping ******-t command.
I can get the prompt to come up, but can't tie 2 together. Any help?
Thanks,
How do I create a batch file to prompt for a name to ping?
Moderator: DosItHelp
-
- Posts: 1
- Joined: 17 Oct 2013 09:42
- Contact:
Re: How do I create a batch file to prompt for a name to pin
Hello.
Like this:
If you want to be really sexy:
Glad to help.
Elizabeth Greene
ExtraParts.Info
Like this:
Code: Select all
@echo off
set /P Target=Please enter the name of the host to ping:
ping %Target%
If you want to be really sexy:
Code: Select all
@echo off
:targetprompt
set /P target=Please enter the name of the host to ping:
if "%target%"=="" (
echo A target is required, or you can press CTRL-C to cancel
goto targetprompt
)
ping %target%
Glad to help.
Elizabeth Greene
ExtraParts.Info
Last edited by ElizabethGreene on 25 Oct 2013 15:48, edited 1 time in total.
Re: How do I create a batch file to prompt for a name to pin
That's what I am talking about. Worked like a champ!
Thanks!!!!
Thanks!!!!