Enable Log on as a Batch Job

Often times you will find the need to have a script run monthly, weekly or even daily on a server. Instead of being a jabroni and running the script manually, you’ll probably use Task Manager to take care of the script for you.

Sometimes, however, Task Manager requires the user account running the task to have remote access to run a batch file. This problem can be a real show stopper and can ruin your day. Without further ado, here is how to fix the issue:

  • Log on to the desired server (typically as local or domain administrator)
  • Start > Run > gpedit.msc and click OK
  • Browse to Computer Configuration > Windows Settings > Security Settings > Local Policies > User Rights Assignment
  • Locate “Log on as a batch job” and double-click to modify the settings
  • Add the desired User or Group

You can now run the script as that user without receiving an error.

Install Fonts via Script – Windows 7

Have a new font and need to push it to everybody’s computer? Here is a simple two-piece script. One is the VB Script that installs the file, the second is a line of code that goes into your existing logon script. Be sure to place the .ttf and .vbs files in a location where everybody has read access.

Place this into the logon script. It checks to see if the font is already installed, and if not, it installs it for you.

if not exist “%systemroot%\Fonts\fontname.ttf” “\\server\folder\fontvbscript.vbs”

Create a .vbs file with the following code (and modify where necessary):

Set objShell = CreateObject(“Shell.Application”)
Set objFolder = objShell.Namespace(“\\server\folder”)
Set objFolderItem = objFolder.ParseName(“fontname.ttf”)
objFolderItem.InvokeVerb(“Install”)

This script works on Windows 7 computers even if UAC is enabled.