Greyware Autoexec Service runs a batch file, or any program of your choice, at boot time.
This provides a secure, reliable method of running startup programs in the security context
of an administrator, the system, or any account you choose.
Typical uses include:
cleaning up temporary files before users log in
making sure print & drive mappings are available (particularly handy in mixed Novell/NT environments)
synchronizing files or directories across a domain
kicking off background jobs, running a backup session,
distributing software upgrades.
For example, you can use the Greyware Autoexec Service to copy the hosts, lmhosts, and services
file from a central source on all your machines at every boot, without having to maintain a
network login batch file system.
1.1.b.970213 - first public release. Added event viewer logging.
1.0.b.960512 - internal use release. Basic functionality established.
Setup and Configuration
Make sure you are logged on as Administrator, or an account with Administrative privileges.
Copy gwautoex.exe to your %systemroot%\system32 directory (usually C:\WINNT\SYSTEM32
on NT 4.x, or C:\WINNT35\SYSTEM32 on NT 3.5x).
Open a CMD prompt window.
gwautoex -install to install on the local machine.
gwautoex -install \\machinename to install on a remote machine.
gwautoex -remove to remove from the local machine.
gwautoex -remove \\machinename to remove from a remote machine.
gwautoex -version to see the version information.
gwautoex -foreground to run the service as a foreground application.
For example, to install the Greyware Autoexec Service on your own machine, copy gwautoex.exe
to your %systemroot%\system32 directory and type gwautoex -install. To remove the service,
type gwautoex -remove.
You must have domain administrative privileges to install or remove the service on another
machine. Assuming you want to install the service on machine Fred, type
gwautoex -install \\fred. The service will copy the file(s) to Fred and install the
service there.
The autoexec job may run in any valid security context. This lets the autoexec job
access files and resources normally blocked from user access.
The autoexec job generates an Event Viewer log entry each time it runs, including
the date and time, name of file run, and number of milliseconds until completion.
Notes
During installation, the Greyware Autoexec Service creates a file called autoexec.cmd
in the %systemroot%\system32 directory. Unless you change the defaults in
the registry, this is the batch file that runs at each startup.
By default, autoexec.cmd has security set so that the system and administrators have full
control, and the special group Everyone has read-only access. This prevents users from
modifying the autoexec.cmd file and then rebooting the machine to run their commands. (Note:
file-level security is only available on NTFS-formatted drives.)
By default, the Greyware Autoexec Service runs under the LocalSystem security context. This gives the
autoexec.cmd program full control over the local machine, but no network access. If you
want your autoexec.cmd to use network resources, you must change the user account. Use
Control Panel / Services / Greyware Autoexec Service / Startup. Pick a user account with
the authority you desire, and provide the proper password.
Also by default, the Greyware Autoexec Service is set to run with the Automatic startup
type. This means that the service will run automatically after the machine boots. The service
turns itself off after running, so although it is set to automatic, it probably won't be running when
you examine the services in Control Panel. You may manually start the service from Control Panel
at any time. It will run and then turn itself off again. Since the service is set to automatic,
it will run once every time you boot the machine.
Greyware Autoexec Service stores its configuration parameters in
HKEY_LOCAL_MACHINE
System
CurrentControlSet
Services
Greyware Autoexec Service
Parameters
The service uses two values:
Directory REG_SZ:
This value defaults to your %systemroot%\system32 directory. It specifies the
current directory when the service is running. You may change this to any valid
local directory.
Filename REG_SZ:
This value defaults to autoexec.cmd. This is the name of the batch
file or executable program the service runs at startup. If no path information
is specified, the program is assumed to be in the directory specified in
the Directory value (see above). By specifying an explicit path here,
you can load the program from one directory and execute it in another.
You may want to have every machine in the domain execute the same batch file on startup.
To do this, specify a UNC path for the Filename value in the registry. For example,
to have all machines run a program found on server Laura in the shared Scripts directory,
specify \\laura\scripts\autoexec.cmd. (Note: Remember that to access network resources,
the service must be running under a valid user context. Use Control Panel to change the
user context under which the service runs.)