batch file to run a command on another server

M

Mike

Hello,

We have a batch file with the following at its contents:
-----------------------------
"D:\Program Files\Cognos\cer3
\bin\runmac32.exe" "E:\CognosData\ScriptFiles\MacroFiles\RE
PORTAUTOMATE.MCX" 65

exit
-----------------------------
Currently the above file is run by the servr admin at the
request of an accounting person to update a file.

I'd like to set this up so that the accounting person can
run the batch file from there desktop without giving them
access to the actual server it runs on.

Is there a way to write this batch file so she can execute
it from her desk and the command will run on the server?

Any help would be appreciated.

Thanks,

Mike
 
T

Technical Joe

You'll have to logon to the server at some point with some
ID/password. If you feel the user will never actually look
at the batch file, you can use a NET USE command with a
specific ID & password to get to the server with the
rights needed to update the files. It lookes like this:
NET USE \\[SERVERNAME]\[SHARE] /USER:[USERNAME] [PASSWORD]

Do a NET USE /? at a CMD prompt to get more information on
syntax.

So your logic is as follows:
Put a batch file on the users machine
Perform a NET USE command with another ID/PWD to get to
the servers' resources
Run the program on the server to update the users' file.
exit

-Technical Joe
 
G

Guest

Please excuse my ignorance on this. I just haven't done a
whole lot with batch files/scripts.

The user currently has access to a share on the server
that includes the bat file that has the lines I pasted in
my original message.

Even with the NET USE command how does the bat file know
to run against the target server and not her local
workstation.

Should I use the UNC names in the bat file?

-----Original Message-----
You'll have to logon to the server at some point with some
ID/password. If you feel the user will never actually look
at the batch file, you can use a NET USE command with a
specific ID & password to get to the server with the
rights needed to update the files. It lookes like this:
NET USE \\[SERVERNAME]\[SHARE] /USER:[USERNAME] [PASSWORD]

Do a NET USE /? at a CMD prompt to get more information on
syntax.

So your logic is as follows:
Put a batch file on the users machine
Perform a NET USE command with another ID/PWD to get to
the servers' resources
Run the program on the server to update the users' file.
exit

-Technical Joe

-----Original Message-----
Hello,

We have a batch file with the following at its contents:
R
E
PORTAUTOMATE.MCX" 65

exit
-----------------------------
Currently the above file is run by the servr admin at the
request of an accounting person to update a file.

I'd like to set this up so that the accounting person can
run the batch file from there desktop without giving them
access to the actual server it runs on.

Is there a way to write this batch file so she can execute
it from her desk and the command will run on the server?

Any help would be appreciated.

Thanks,

Mike
.
.
 
M

Mark V

In said:
Please excuse my ignorance on this. I just haven't done a
whole lot with batch files/scripts.

The user currently has access to a share on the server
that includes the bat file that has the lines I pasted in
my original message.

Even with the NET USE command how does the bat file know
to run against the target server and not her local
workstation.

Should I use the UNC names in the bat file?

You could do that to specify the UNC paths, however I believe you are
asking about having the exectuable execute in server memory space as
opposed to the workstation's...

Okay, so USER is not an admin on the server. USER needs a file to
execute _on_ the server by request. Ok so far? Does this need to
execute immediately or just run at some point after the USER requests
it. IOW is it a real-time task or just a request to execute?

There are several approaches...

I've had a scheduled (on and for the server) task running and
checking for the presense of a file, then do something. In which
case the USER need only be able to create a file on a share...

If you can pin down the definition of what you need to do someone
will have a good answer(s) for you.


-----Original Message-----
You'll have to logon to the server at some point with some
ID/password. If you feel the user will never actually look
at the batch file, you can use a NET USE command with a
specific ID & password to get to the server with the
rights needed to update the files. It lookes like this:
NET USE \\[SERVERNAME]\[SHARE] /USER:[USERNAME] [PASSWORD]

Do a NET USE /? at a CMD prompt to get more information on
syntax.

So your logic is as follows:
Put a batch file on the users machine
Perform a NET USE command with another ID/PWD to get to
the servers' resources
Run the program on the server to update the users' file.
exit

-Technical Joe

-----Original Message-----
Hello,

We have a batch file with the following at its contents:
R
E
PORTAUTOMATE.MCX" 65

exit
-----------------------------
Currently the above file is run by the servr admin at the
request of an accounting person to update a file.

I'd like to set this up so that the accounting person can
run the batch file from there desktop without giving them
access to the actual server it runs on.

Is there a way to write this batch file so she can execute
it from her desk and the command will run on the server?

Any help would be appreciated.

Thanks,

Mike
.
.
 
M

Mike

You are correct. I want the bat file to execute on the
server, not on the user's workstation.

This is a real-time task that cannot be scheduled. Due to
how some of our processes accounting needs to run this on-
demand at certain times.
 
J

Jerold Schulman

See PsExec at tip 4141 in the 'Tips & Tricks' at http://www.jsiinc.com

Hello,

We have a batch file with the following at its contents:
-----------------------------
"D:\Program Files\Cognos\cer3
\bin\runmac32.exe" "E:\CognosData\ScriptFiles\MacroFiles\RE
PORTAUTOMATE.MCX" 65

exit
-----------------------------
Currently the above file is run by the servr admin at the
request of an accounting person to update a file.

I'd like to set this up so that the accounting person can
run the batch file from there desktop without giving them
access to the actual server it runs on.

Is there a way to write this batch file so she can execute
it from her desk and the command will run on the server?

Any help would be appreciated.

Thanks,

Mike


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
G

Guest

Wil try PSEXEC and post update on how it worked for me.

Thanks for all the tips.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top