Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Basic Dos Question


  • Please log in to reply
6 replies to this topic

#1 yano

yano

    I can see what you post!


  • Members
  • 6,469 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:02:05 PM

Posted 12 March 2006 - 09:38 PM

Ok, I'm trying to write a batch file, and it's been a while since I've done a lot of this, and I forget how you get input from the user.

I want to ask the user for either a word or a number and then have it run on the next line.

Here is an example:

What is IP/PC name?: (user enters either pc name, or IP address)

then inside the batch file I want it tot take that input and do this:

ping (input)


any ideas? I want to keep this simple, if possible...

BC AdBot (Login to Remove)

 


m

#2 acklan

acklan

    Bleepin' cat's meow


  • Members
  • 8,529 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Baton Rouge, La.
  • Local time:01:05 PM

Posted 12 March 2006 - 11:26 PM

Could you not load that into the Autoexec.bat to execute at startup?
"2007 & 2008 Windows Shell/User Award"

#3 yano

yano

    I can see what you post!

  • Topic Starter

  • Members
  • 6,469 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:02:05 PM

Posted 12 March 2006 - 11:32 PM

What?

No I just want to make a batch file that will ping a computer on my LAN, using the given IP address or computer name.

#4 acklan

acklan

    Bleepin' cat's meow


  • Members
  • 8,529 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Baton Rouge, La.
  • Local time:01:05 PM

Posted 13 March 2006 - 12:05 AM

Sorry. For some reason I though you want it to ping at boot. I have nnoooo idea what I was thinkin.
"2007 & 2008 Windows Shell/User Award"

#5 yano

yano

    I can see what you post!

  • Topic Starter

  • Members
  • 6,469 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:02:05 PM

Posted 13 March 2006 - 12:11 AM

Oh, lol. It's ok.

But do you know anything about user input though?

Edited by yano, 13 March 2006 - 12:11 AM.


#6 acklan

acklan

    Bleepin' cat's meow


  • Members
  • 8,529 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Baton Rouge, La.
  • Local time:01:05 PM

Posted 13 March 2006 - 12:18 AM

I have dusted off all my old DOS books (3.3, 4.01, 6.2) trying to find the answer. Have not needed a .bat since '97. Hopefully one of us will figure it out.
"2007 & 2008 Windows Shell/User Award"

#7 Herk

Herk

  • Members
  • 1,609 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:S.E. Idaho, USA
  • Local time:03:05 PM

Posted 10 April 2006 - 01:05 PM

CHOICE command. Starting with DOS 6.0.

Example:

@echo off
CLS
ECHO 1. WordPerfect
ECHO 2. Lotus 1-2-3
ECHO.
CHOICE Which program do you want to run /C: 12
IF ERRORLEVEL 2 GOTO LOTUS

CD\WP51
WP GOTO END

:LOTUS
CD\ 123
123
:END




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users