Error "The operation was canceled by the user"

December 14th, 2010 - 03:01 pm ET by Zaphod Beeblebrox | Report spam
I'm getting the error "The operation was canceled by the user" when
trying to launch a utility using objShell.run. What I'm trying to do
is flash the BIOS of our Dell PCs during system image deployment. The
shipping staff need to boot the PC to a CD, have it flash the BIOS to
the correct version (if necessary), then apply a system image to the
PC. The boot CD is running Windows PE 2 with WSH installed
(essentially, a stripped-down Vista boot environment), and everything
seems to be going fine up to the point where I need to launch the BIOS
flash utility. The section of the script that generates the error is:

If strItemSMBIOSBIOSVersion = "A03" Then
' Don't do anything, PC is ready for imaging
Else
' PC needs BIOS flashed
Set objShell = CreateObject("WScript.Shell")
objShell.Run("O780-A03.exe -NOPAUSE -NOREBOOT"),1,True
End If

The script is run from within a .cmd file that gets launched in the
Windows PE Command Shell on startup, using 'cscript flashbios.vbs'.
When the script gets to
'objShell.Run("O780-A03 -NOPAUSE -NOREBOOT"),1,True', it exits with
the error message 'flashbios.vbs(53,9) (null): The operation was
canceled by the user.' If I replace "O780-A03.exe -NOPAUSE -NOREBOOT"
with "PING -t 127.0.0.1" it works fine. The O780-A03.exe utility is
in the same directory as ping.exe (X:\Windows\System32). The utility
runs just fine using the same command line if I drop out of the script
into the Windows PE Command Shell and launch it from there. I don't
know if it is related, but I get the same error if I try to launch any
utility from a network share in the vbs script (which is why I've
copied it to the local X:\Windows\System32 directory), but all run
fine from the Command Shell. I can't explain why I get that
particular error in either circumstance, and I've not had any luck
Googling for a solution, so I hope someone here can help.

Zaphod

Vell, Zaphod's just zis guy, ya know? - Gag Halfrunt
email Follow the discussionReplies 9 repliesReplies Make a reply

Replies

#1 Special Access
December 14th, 2010 - 09:58 pm ET | Report spam
On Tue, 14 Dec 2010 15:01:29 -0500, "Zaphod Beeblebrox"
wrote:

<snip>

If strItemSMBIOSBIOSVersion = "A03" Then
' Don't do anything, PC is ready for imaging
Else
' PC needs BIOS flashed
Set objShell = CreateObject("WScript.Shell")
objShell.Run("O780-A03.exe -NOPAUSE -NOREBOOT"),1,True
End If



<snip>

Try changing the line
objShell.Run("O780-A03.exe -NOPAUSE -NOREBOOT"),1,True
to
objShell.Run("O780-A03.exe -NOPAUSE -NOREBOOT",1,True)

Mike

Similar topics