Computing.Net > Forums > Disk Operating System > Batch File That Accepts User Input

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch File That Accepts User Input

Reply to Message Icon

Name: powlaz
Date: March 5, 2008 at 13:38:28 Pacific
OS: XP Pro SP2
CPU/Ram: P4
Product: Dell Optiplex
Comment:

I need a little help with a batch file that I will run from my Windows XP computer.

I plan to use this simple PSKill line:

pskill -t \\CS1 -u administrator -p password gmw6.exe

to remotely close the gmw6.exe program when it is problematic.

What I'd like to be able to do is have the script prompt me for the computer name (CS1 in the above example), insert what I enter and then run. I think I do that with the 1% (variable is it?) but I could use some guidance.

In the end, when I get a call that gmw6.exe is acting up I won't have to go to the PC, or access it remotely, I will just be able to enter the name of the computer when my script prompts me and it will do the rest of the work.

Thanks for the help.

Po



Sponsored Link
Ads by Google

Response Number 1
Name: alexanrs
Date: March 5, 2008 at 15:34:42 Pacific
Reply:

You could do it like this:

pskill -t \\%1 -u administrator -p password gmw6.exe

But the program will not "prompt" you for the input. The computer name should be provided in the command line, so if your batch is called "problem.bat" you should run it like this (from the Prompt)

problem CS1

But this is for bare DOS. In Windows XP you can also do this:

SET /P COMPNAME=Enter the computer name
pskill -t \\%COMPNAME% -u administrator -p password gmw6.exe
SET COMPNAME=

This would actually prompt you to enter the name, so you could just put the BAT in the desktop and double click whenever necessary.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Batch File That Accepts User Input

DOS Batch - Accepting User input to system Variable www.computing.net/answers/dos/dos-batch-accepting-user-input-to-system-variable/658.html

writing batch files www.computing.net/answers/dos/writing-batch-files/1545.html

How do u make a batch file that runs whenever the computer boots up www.computing.net/answers/dos/how-do-u-make-a-batch-file-that-runs-whenever-the-computer-boots-up/3744.html