Running batch file

  • Thread starter Thread starter Divyesh Shah
  • Start date Start date
D

Divyesh Shah

I am having a network with Windows NT4.0 sp6a as a server
and all my users are running Windows 2000 Pro. I have
written a batch file that goes and installs various
patches and softwares on a workstation provided the
session is logged in using Admin. I want to let the users
run the batch file instead of me going around the company
or giving them a admin password. Can some pls. help with
the best way around this?
Thanks,
Divyesh Shah
 
Did you try use the batch file as a log on script? That would install the
patches as soon as the client logged on the network.
 
I can do that but won't that run the batch file everytime
the user logs in and won't that need admin rights?
DS
 
Letting users run installation files is not a good idea, for these
reasons:
- Problems with access rights
- You will never know if they do it (some won't!)
- You will never know if the installation was successful or not

A much better way is to do it by remote control:

psexec \\SomePC -u LocalAdmin c:\Tools\install.bat

PSExec.exe will start a command session on the nominated
PC. You can get it freely from www.sysinternals.com. You can
even automate the process so that all machines are updated
in one hit!
 
Divyesh said:
I am having a network with Windows NT4.0 sp6a as a server
and all my users are running Windows 2000 Pro. I have
written a batch file that goes and installs various
patches and softwares on a workstation provided the
session is logged in using Admin. I want to let the users
run the batch file instead of me going around the company
or giving them a admin password. Can some pls. help with
the best way around this?

Hi

If the PsExec solution suggested by Pegasus is not an option:

Some non-interactive RunAs utilities listed here:
http://groups.google.com/[email protected]
 
First of all I would like to "Thank You" all for your
suggestions. I tried the PSEXEC and it works fine for what
I want to do. Now I am trying to install some softwares on
user machines using this method. I use PSEXEC
\\machinename -s file.bat. "File.bat" consists of few
programs that I am trying to install but they need some
interaction like hiting the next key etc. This makes the
installation stop. Actually, it doesn't stop but is
waiting for a key stroke but doesn't show up anywhere. If
I use the -i switch it shows up on the users machine which
I don't want to happen. Is there a way to fully automate
this?
Thanks in advance.

Divyesh Shah
 
Divyesh said:
First of all I would like to "Thank You" all for your
suggestions. I tried the PSEXEC and it works fine for what
I want to do. Now I am trying to install some softwares on
user machines using this method. I use PSEXEC
\\machinename -s file.bat. "File.bat" consists of few
programs that I am trying to install but they need some
interaction like hiting the next key etc. This makes the
installation stop. Actually, it doesn't stop but is
waiting for a key stroke but doesn't show up anywhere. If
I use the -i switch it shows up on the users machine which
I don't want to happen. Is there a way to fully automate
this?

Hi

Some installation packages take command line parameters to do a unattended
installation, you need to look into this to solve that problem...
 
Actually, the few things I am running in my file.bat file
are SP4 and IE6. It waits for me to hit the enter key at
afew places. Is there a way around this? Also, is there a
way to run a .bat file with a run as option. I can run all
the exe's but .bat's that I created are not giving me that
option when I press the shift and right click when
pointing to that file.

Divyesh Shah
 
Divyesh said:
Actually, the few things I am running in my file.bat file
are SP4 and IE6. It waits for me to hit the enter key at
afew places. Is there a way around this?

Hi

For tips on how to make SP4 unattended, take a look at the section
"Command-Line Options for W2ksp4.exe and Update.exe" in the "Microsoft Windows
2000 Service Pack 4 Installation and Deployment Guide" found at
http://www.microsoft.com/windows2000/downloads/servicepacks/sp4/spdeploy.htm


For IE, you will find information about command line switches necessary for an
unattended install in the links below:

Internet Explorer Batch Mode Setup Switches
http://support.microsoft.com/?kbid=200007

Installing Internet Explorer 5 to Windows NT 4.0 Using SMS 1.2
http://support.microsoft.com/?kbid=223371

Additional Internet Explorer batch setup and IExpress batch setup switches
http://www.microsoft.com/windows/ieak/techinfo/deploy/60/en/ieswitch.htm
 
I don't think psexec is suitable for running programs in a
GUI environment, if they require user input. There are several
ways to get around this problem:

- Supply the required input on the command line, as Torgeir suggested.
- Script the installation, if the application supports it (many Microsoft
applications can be scripted).
- Use sysdiff.exe to prepare the installation, then roll it out with
psexec.exe.
- Install the application by using a remote takeover program, such
as WinVNC (which has to be installed too . . .).
 
Guy's, thanks for the ideas. I shall try them later. I am
sorry for mixing two things here. The "Run-As" issue was
actually a seperate issue. It has nothing to do with the
one of PSExec

Divyesh Shah
 
Back
Top