Scheduled Tasks

Viewing 1 post (of 1 total)
  • Author
  • Avatar

    Hi I am completely out of ideas on what I need to do to get a couple of batch files to run from scheduled tasks.

    Basically I have a collection of VMs running in Hyperv, all but 1 is running windows xp the other is 2k3 std server.

    The first bat file to be run is called vm_suspent.bat and its on the root of c:

    This batch file shuts down all vms using the following script

    net use y: [URL=”file://\femputerhyper-v”]\femputerhyper-v[/URL]

    %SystemRoot%system32WindowsPowerShellv1.0powershell.exe . C:hypervhyperv.ps1;shutdown-vm izac
    %SystemRoot%system32WindowsPowerShellv1.0powershell.exe . C:hypervhyperv.ps1;shutdown-vm sage
    %SystemRoot%system32WindowsPowerShellv1.0powershell.exe . C:hypervhyperv.ps1;shutdown-vm firewarll_log
    %SystemRoot%system32WindowsPowerShellv1.0powershell.exe . C:hypervhyperv.ps1;shutdown-vm MMS1

    As you can see it maps a drive on another machine, and powers down the VMs, this works fine when I run the batch file manually.

    The 2nd batch file is called backup.bat and is also on the root of c:

    this copies the vm files to the remote drive mapped above, then starts the machines up again using the following.

    xcopy “z:Virtual Machinessage” “y:%DATE%sage” /I /Y
    %SystemRoot%system32WindowsPowerShellv1.0powershell.exe . C:hypervhyperv.ps1;start-vm sage

    xcopy “z:Virtual MachinesMMS1” “y:%DATE%MMS1” /I /Y
    %SystemRoot%system32WindowsPowerShellv1.0powershell.exe . C:hypervhyperv.ps1;start-vm mms1

    xcopy “z:Virtual MachinesFWlogs” “y:%DATE%FWlogs” /I /Y
    %SystemRoot%system32WindowsPowerShellv1.0powershell.exe . C:hypervhyperv.ps1;start-vm firewarll_log

    xcopy “z:Virtual MachinesIZAC” “y:%DATE%IZAC” /I /Y
    %SystemRoot%system32WindowsPowerShellv1.0powershell.exe . C:hypervhyperv.ps1;start-vm izac

    When I try to schedule these I get

    results of 0x800704DD on the first batch file and
    0x8007010B on the 2nd.

    There are no quotation marks in the run in section of the scheduled task, there are no spaces in the names.

    Any help would be very appreciated.


Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.