1

I made a script to backup VMs on CSVs which works great except that I cannot get disk2vhd.exe to run. The script is run from a server with windows 2008 installed. Since a lot of our VMs use Windows 2003 (w/o PS), I have to do everything the complicate way.

First thing I tried was to just create a batch file and execute it with WMI. The batch file is indeed executed, but somehow, disk2vhd is not started.
By the way, the command I use to start disk2vhd works perfectly fine when I copy it into the cmd console on the VM directly!

I then also tried to use psexec and only passed this certain command (cmd /c $command). Again nothing.
Could this perhaps be a problem with UAC or permissions?

Carl B
  • 6,660
Maru
  • 121

2 Answers2

0

This isn't an answer, but rather a series of comments and clarifying questions. Seeing as you can't "comment" until you have a rep of >50 here goes...

This question is probably better suited for ServerFault.

Is it possible to see the script you are attempting to run? In addition you don't actually mention what type of failure occurs. Does the exe just not run or is there an output message directly stating what the issue is?

I'm not real familiar with disk2vhd, but it sounds as if your're running that on a VM. Is that correct? Are you attaching the VHD on a separate system?

Qwilson
  • 646
0

Please hit me for I am really stupid.

It really was a problem with UAC. I have to run the command in elevated mode. For this I need a switch.
Now the line of code looks like this:

&"$CONST_PWD/psexec" -accepteula $rs -h -u $SETUP_USER -p $SETUP_PASSWORD C:\vmbackup\disk2vhd.exe $tVMdisk $sd -accepteula

See the -h ? Yeah, that was the missing thingy.
At least, my script finally works like a charm. Thank you all!

Maru
  • 121