[THIN] Re: OT: Passing parameters in batch
- From: "Ziots, Edward" <EZiots@xxxxxxxxxxxx>
- To: "'thin@xxxxxxxxxxxxx'" <thin@xxxxxxxxxxxxx>
- Date: Wed, 11 Dec 2002 15:48:38 -0500
Possibly "" "" the %%I, also have echo ON and a pause when the script runs
and that should show you what is going wrong.
Possibly set it up this way.
FOR /F %%I in (Servers.txt) do killit.bat %%I
Killit.bat (Snipit)
pskill \\%1 -u adminacct -p adminpassword app.exe
pause
This should call killit.bat which will substitute each server name for %1 in
the batch file and attempt to kill all instances of app.exe.
Also doing the following would work.
FOR /F %%I in (servers.txt) do psexec \\%%I kill -f app.exe
HTH,
Ed
-----Original Message-----
From: Bill.Ramby@xxxxxxxxxxx [mailto:Bill.Ramby@xxxxxxxxxxx]
Sent: Wednesday, December 11, 2002 2:39 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: OT: Passing parameters in batch
Nope, didn't work. If you don't mind my asking, what was the basis for
putting a single quote around the text?
-----Original Message-----
From: Sullivan, Glenn [mailto:GSullivan@xxxxxxxxxxxxxx]
Sent: Wednesday, December 11, 2002 2:31 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: OT: Passing parameters in batch
Change servers.txt to ('servers.txt').
Glenn Sullivan, MCSE+I MCDBA
David Clark Company Inc.
-----Original Message-----
From: Bill.Ramby@xxxxxxxxxxx [mailto:Bill.Ramby@xxxxxxxxxxx]
Sent: Wednesday, December 11, 2002 1:51 PM
To: thin@xxxxxxxxxxxxx
Subject: [THIN] OT: Passing parameters in batch
My batch filing is rusty so I need some help.
I'm writing a script to do a remote pskill on several servers. I have the
servers listed in a file called servers.txt All servers in the list have a
\\ in front of them.
Theusage for pskill is;
PsKill terminates processes on a local or remote NT system.
Usage: pskill [\\RemoteComputer [-u Username]] <process Id or name>
-u Specifies optional user name for login to
remote computer.
The batch file looks like this
for /f %%i in servers.txt do pskill.exe %%i -u adminacct -p adminpassword
app.exe
If I run just the last part in a cmd prompt replacing the %%i with the
actual machine name, it works just fine. But from the script it bombs out
completely. Any ideas?
Thanks in advance.
***********************************************
This Weeks Sponsor: triCerat Inc.
triCerat introduces RegSet. Registry
Administration Simplified.
http://www.triCerat.com
************************************************
For Archives, to Unsubscribe, Subscribe or
set Digest or Vacation mode use the below link.
http://thethin.net/citrixlist.cfm
***********************************************
This Weeks Sponsor: triCerat Inc.
triCerat introduces RegSet. Registry
Administration Simplified.
http://www.triCerat.com
************************************************
For Archives, to Unsubscribe, Subscribe or
set Digest or Vacation mode use the below link.
http://thethin.net/citrixlist.cfm
***********************************************
This Weeks Sponsor: triCerat Inc.
triCerat introduces RegSet. Registry
Administration Simplified.
http://www.triCerat.com
************************************************
For Archives, to Unsubscribe, Subscribe or
set Digest or Vacation mode use the below link.
http://thethin.net/citrixlist.cfm
***********************************************
This Weeks Sponsor: triCerat Inc.
triCerat introduces RegSet. Registry
Administration Simplified.
http://www.triCerat.com
************************************************
For Archives, to Unsubscribe, Subscribe or
set Digest or Vacation mode use the below link.
http://thethin.net/citrixlist.cfm
Other related posts: