PC Review


Reply
Thread Tools Rate Thread

batch file to run a command on another server

 
 
Mike
Guest
Posts: n/a
 
      26th Aug 2004
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
 
Reply With Quote
 
 
 
 
Technical Joe
Guest
Posts: n/a
 
      26th Aug 2004
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:
>-----------------------------
>"D:\Program Files\Cognos\cer3
>\bin\runmac32.exe" "E:\CognosData\ScriptFiles\MacroFiles\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
>.
>

 
Reply With Quote
 
Guest
Posts: n/a
 
      26th Aug 2004
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:
>>-----------------------------
>>"D:\Program Files\Cognos\cer3
>>\bin\runmac32.exe" "E:\CognosData\ScriptFiles\MacroFiles\

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
>>.
>>

>.
>

 
Reply With Quote
 
Mark V
Guest
Posts: n/a
 
      26th Aug 2004
In microsoft.public.win2000.cmdprompt.admin wrote:

> 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:
>>>-----------------------------
>>>"D:\Program Files\Cognos\cer3
>>>\bin\runmac32.exe" "E:\CognosData\ScriptFiles\MacroFiles\

> 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
>>>.
>>>

>>.
>>


 
Reply With Quote
 
Mike
Guest
Posts: n/a
 
      26th Aug 2004
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.

 
Reply With Quote
 
Randall Flag
Guest
Posts: n/a
 
      27th Aug 2004
Hi

take a look at the psexec tool from www.sysinternals.com this will execute
the script remotely on the server


"Mike" <(E-Mail Removed)> schrieb im Newsbeitrag
news:0d0301c48ba0$582674c0$(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
Jerold Schulman
Guest
Posts: n/a
 
      27th Aug 2004

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

On Thu, 26 Aug 2004 07:49:44 -0700, "Mike" <(E-Mail Removed)>
wrote:

>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
 
Reply With Quote
 
Guest
Posts: n/a
 
      27th Aug 2004
Wil try PSEXEC and post update on how it worked for me.

Thanks for all the tips.

Mike
>-----Original Message-----
>
>See PsExec at tip 4141 in the 'Tips & Tricks' at

http://www.jsiinc.com
>
>On Thu, 26 Aug 2004 07:49:44 -0700, "Mike"

<(E-Mail Removed)>
>wrote:
>
>>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
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch file works in command line but not as a batch Danger Windows XP General 7 5th Feb 2008 04:50 PM
Batch Command to tell if a service is running on a server Des Microsoft Windows 2000 Advanced Server 2 23rd Mar 2005 04:12 PM
Batch Command to tell if a service is running on a server Des Microsoft Windows 2000 Developer 2 23rd Mar 2005 04:12 PM
Batch Command to tell if a service is running on a server Des Microsoft Windows 2000 Networking 3 23rd Mar 2005 04:12 PM
Batch Command to tell if a service is running on a server Des Microsoft Windows 2000 Applications 2 23rd Mar 2005 04:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:19 PM.