Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remote execute BAT file 1

Status
Not open for further replies.

kevinnaomi

IS-IT--Management
Sep 26, 2002
81
0
0
US
I have a network of about 100 users. We use McAfee 4.5.1 as anti-virus software. It is scheduled to autoupdate everyday at 10am. There is 2 problems I would like to try to fix.
1. The autoupdate does not always work correctly.
2. McAfee`s regular definition update is on Thursday but sometimes special updates are released.

What I would like to be able to do is run a BAT file on specific PCs. I have created the BAT file and it works great. I just need to be able to execute it from my PC.

As my regular login is not a Domain Administrator or local administrator on any of the PCs this could prove to be a problem.

If anyone could provide some suggestions, it would be greatly appreciated.
 
Maybe an idea : The batch file is sceduled to run every day at a fixed time at the remote computer. But the batch file is modified to check if a certain file (at the local machine) is existing. If not, no action is performed.
The control file, when found, resides in a shared folder, and you must have write access to that folder.
When you wish to start the program, you run a new batch job on your server. That job copies the control file to the host. In the batch file on that machine, a final command deletes the control file after the update has been performed.
 
Thanks for the ideas. However, I do not want to schedule the job. The idea of what I want to do is to be able to run the job on the remote machine when required. Scheduling it would create unneccessary network traffic.

PSEXEC - I have tried this but could not get it to work. PSEXEC will run EXE files on a remote machine but I could not get it to run BAT files.
 
Can't you just put the DAT file on a shared drive that everyone maps to, then use psexec to run the dat.exe file with a /s (silent) switch? [auto] MCSE NT4/W2K
 
OK. I tried to setup PSEXEC to run the DAT file from a network drive that is mapped at login. I create a bat file with the following line:

psexec \\PCNAME s:\common folder\DAT.exe /s

Everytime I tried to run the BAT file, I received a access denied message.

Any ideas????
 
If the batch file is scheduled locally, and it normally contains only a rem command, it should generate no network traffic. When you wish something to be done, the batch file can be overwritten by another batch file. At the end of that file, a command is given to reset the scheduled batch file to 'no action'. (?)
 
Is the s: drive mapped on \\PCNAME?

You can get psexec to copy the app its running by adding -c param, so:-

psexec -c \\PCNAME DAT.exe /s,

where DAT.exe is local to machine you're running psexec on (and in the path of where you're running psexec) should work.

PS. Psexec will also run .bat files on remote machine.
 
I too am getting a access is denied when trying to run psexec. I am running on a win2000 5.00.2195 client and trying to access a winnt 4.00.1381 server.

I run the folling command

psexec \\server-name -u username ipconfig and receive a prompt for a password. I key in the password from the network sigon (username) is also from the network sign on.

and receive the message "access is denied".

I have tried the following options.
- have a drive mapped to the server
- no drive mapped to the server
- the same userid/password set up on the server
- no userid/password set up on the server.

What am I missing??????

 
Have the users you're supplying got permission to run jobs on the server you're targetting?
 
Thanks for the lead. It now works!!!!!!

the userid that I was using to logon to the server was not part of a "group name" that had the privilages that I needed. Once I added the userid to the group, it inherited the necessary privilages and now works.

THANK YOU WOLLUF for the question that sent me looking in the right place.
 
Can I ask what it was you cnaged to get round the permissions thing?

We have 2 servers, and psexec works on one fine, but on the other, I get the access denied. I have tried passing in the username/password, and thi gives me "The credentials supplied conflict with an existing set of credentials".

Also, the permissions on both servers seem to be the same, although I may be missing something here....

 
Matt,

On the troublesome machine, have you tried more than one username/password? (eg, could you set up a new user id on the server just for running psexec).
 
I have tried a couple of usernames, none of them seem to work. I did howver get our techy guy to try the tool, and it worked on his PC although he is logged in as an Administrator. This suggests a permissions thing with my username, but I am a member of the administrators group, and should have full permissions (I can log on to the PC and do anything). If I try supllied any other username like this:

psexec -u DOMAIN\SOMEONE -p PASSWORD xxx.bat

Then I get the conflicting credentials message...

Does that shed any light?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top