Computer Repair & Services for NJ New Jersey Businesses & Home Users
Instructions for Administrators for Windows 2000 only.
ALLOWING A REGULAR USER TO RUN THE SCRIPTS:
The Runas.zip file below contains modified files to defrag 1 to 4 partitions and a shortcut named "Runas" to run a runas command. You should not use this shortcut as the shortcut to run the script. The shortcut should be placed in the C:\Winnt\System32 folder and it should only be used by the script to launch the Defragmenter console. You must create your own desktop shortcut to the vbs file to run it at any time you like. Choose the correct vbs file from the zipped file for the number of partitions that you have.
1. You should create a user with administrator rights on the local machine.
2. In my examples the user is John and his password is password. Using Notepad, you should open up the vbs file and substitute the correct password (for the administrator account you will be using) into the script where it says "password".
3. By right clicking the "Runas" shortcut and choosing Properties, you should substitute the correct administrator account name into the properties of the shortcut where it says John.
You don't have to change the scripts or shortcut at all if you create a user named John, make John a member of the Administrators group and make his password be password.
4. Place the "Runas" shortcut into the C:\Winnt\System32 folder, as that is where the script will look for it.
The script is using the runas command so you can run the defrag as an administrator even though a normal user may be logged in. You should make sure the Runas service is running on the machine. Be advised that you are opening up a hole in your security since a savvy local user could obtain an administrator name and the corresponding password if he/she were to look at the script and the shortcut.
SCHEDULING THE SCRIPTS TO RUN:
Use Scheduled Tasks in Control Panel. Use the Add Scheduled Task wizard and use the browse button to point to the script.
Now here's the strange part. Let's say you want to run the script every Thursday night at 11:00PM. Well, whoever is usually logged in at that time, must be the one who schedules it to run. No administrator rights are needed to schedule the task. As a matter of fact, the administrator can't change what a regular user has scheduled. You would think that if the administrator scheduled the defrag script to run, it would run no matter who was logged on, not so. Go figure! If the user who scheduled it isn't logged on, it won't run. This may hold true for all scheduled tasks.
By using this code or the files available for downloading you agree to the Warranty Disclaimer
DISCLAIMER OF WARRANTY
IN NO EVENT SHALL THE AUTHOR BE HELD LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS OR PERSONAL INFORMATION, OR ANY OTHER LOSS ARISING FROM THE USE OR INABILITY TO USE THE SOFTWARE.
Download Runas.zip containing four vbs files and the "Runas" shortcut 4KB I Agree
You Are visitor number to this Web page.
trademarks used are properties of their respective owners.
Last modified: June 19, 2014