Upgrading from Windows Enterprise 8 to 8.1 on Oracle VirtualBox Using OS X

Windows Server logo

I’ve been using Windows 8 Enterprise with Oracle VirtualBox on my MacBook Pro, which runs OS X Mavericks (10.9).  Now that Windows 8.1 has been released, I decided to upgrade.  I had read that the upgrade was fairly easy, and could be done through the Windows Store.  This is not always the case – such as when you are running the Enterprise version.

If you are running the Enterprise version of Windows 8, you must install from DVD media, or a mounted .iso, or equivalent.  I downloaded the iso file from MSDN and mounted it in OS X to install the upgrade.  At this time, I came across an error I had never seen before:

“You can’t install Windows 8.1 because your processor doesn’t support CompareExchange128″.

Fortunately, this can be easily fixed.  Open a Terminal Window and change directories to your VirtualBox.app directory.  (This step may be unnecessary if your path is set up correctly.)

Next, at the command prompt, type:

vboxmanage setextradata [vmname] VBoxInternal/CPUM/CMPXCHG16B 1 <ENTER>

“[vmname]” should be the name of your VM, which in my case was “Windows 8 Enterprise”.  Quotes are necessary if there are spaces in the name.

Restart your Windows 8 VM and try to install again!

Moving Multiple Scheduled Tasks into a Folder on Windows Server 2008

Windows Server logo

Let’s say you have a whole lot of scheduled tasks you want moved into a subfolder in the Task Scheduler.  Since you can’t just drag and drop the tasks, and must export the jobs into XML files to be imported, we will use similar commands as yesterday’s post.

For this, you will need an empty folder.  I use C:temp for this example.  If your folder does not already exist, create one.  Also, you will need a folder in the Task Scheduler GUI to exist.  Create it using the Task Scheduler GUI.

Export all jobs you want to move into XML files:

  1. Open the Command Prompt, and change to the C:WindowsTasks folder.
  2. Type the following command and press Enter: FOR /R . %F in (*.job) do schtasks /Query /TN “%~nF” /XML > “C:temp%~nF.xml”

This will create all XML files in the C:temp folder.  You can then delete from that folder any XMLs for jobs that you don’t want moved.

Next, delete the jobs in the original folder either using the command line or through the GUI.

Lastly, enter the following command and press Enter:

FOR /R c:temp %F in (*.xml) do schtasks /Create /S <<server name>> /RU <<username>> /RP <<password>> /XML “c:temp%~nF.xml” /TN “<<Task Scheduler folder name>>%~nF”

This will recreate the job files and put the tasks into the folder (in the GUI) of your choosing.

Importing Multiple Scheduled Tasks from Windows XP/Server 2003 to Windows 7/Server 2008

Windows Server logo

On Windows XP and Windows Server 2003, Scheduled Tasks are stored as binary files with the “.job” extension. They are also stored in this manner on Windows Server 2008. Also, the jobs are stored in the same location in both operating systems, namely, “C:WindowsTasks”. So if you want to copy jobs from one to the other, you should just be able to copy the files, right? No, that would be too easy. For whatever reason, Microsoft chose to make it much more difficult to migrate jobs than this.

To successfully import jobs, several steps are required.

First of all, copy all “.job” files on the XP/2003 box into a folder of your choosing on the 2008 box. I’ll create “C:temptasks” for this example.
Next, copy two files – schtasks.exe and schedsvc.dll – from C:WindowsSystem32 on the source box into the C:temptasks folder on the destination box.
Thirdly, copy (don’t move) the job files from the C:temptasks folder into the C:WindowsTasks folder on the destination box.

Now for the fun part. To import a job, the following command must be issued from the Command Prompt:
schtasks /change /TN <<Scheduled Job Name>> /RU <<Username>> /RP <<Password>>

This command will only import one job – the one with whatever name you put in the command.  If you have many jobs to import, this will not be practical.  You’ll need a script to do this, but fortunately the script is simple.

By using a for loop and a basic regular expression, this can be done at the command line:

c:temptasks>FOR /R . %F in (*.*) do schtasks /change /TN “%~nF” /RU <<Username>> /RP <<Password>>

This will import all of your job files into the Task Scheduler. The tasks may be in an enabled state, so be sure to check this if you don’t want them to run yet.