# Solved: Batch file (DOS) for XP



## silverseed71 (Jan 18, 2010)

I am trying to do a simple batch file......

cmd
ping LAPTOP<insert#>

where the <insert#> is where the user will insert the 4 digit number of that laptop so I can get a ping on it.


----------



## Squashman (Apr 4, 2003)

Do not name this batch file ping.bat. You will get highly undesirable results.

```
@echo off
SET /P _number=[Enter 4 digit number]:
ping LAPTOP%_number%
```


----------



## silverseed71 (Jan 18, 2010)

I didn't. Thank you for the code!!!


----------



## managed (May 24, 2003)

You might want to make a couple of changes so it looks like this :-



> @echo off
> SET /P _number=[Enter 4 digit number]:
> ping %_number%
> pause


----------



## silverseed71 (Jan 18, 2010)

It worked that way. Thanks.


----------

