Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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?

share|improve this answer
    
Thank you for reminding me. I did solve this problem. –  Marco Alka Mar 28 '13 at 9:12
up vote 0 down vote accepted

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!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.