Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Subject: Batch File That Accepts User Input

Original Message
Name: powlaz
Date: March 5, 2008 at 13:38:28 Pacific
Subject: Batch File That Accepts User Input
OS: XP Pro SP2
CPU/Ram: P4
Model/Manufacturer: 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


Report Offensive Message For Removal

Response Number 1
Name: alexanrs
Date: March 5, 2008 at 15:34:42 Pacific
Subject: Batch File That Accepts User Input
Reply: (edit)
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.


Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Batch File That Accepts User Input

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software



Version Tracker Pro
Keep your software current and secure, effortlessly

Click Here for a Free Scan

Driver Agent
Automatically find the latest drivers for your computer.
Click Here for a Free Scan



The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC