Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error "The operation was canceled by the user"

1,122 views
Skip to first unread message

Zaphod Beeblebrox

unread,
Dec 14, 2010, 3:01:29 PM12/14/10
to
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


Message has been deleted

Tom Lavedas

unread,
Dec 15, 2010, 8:50:29 AM12/15/10
to
On Dec 14, 9:58 pm, Special Access <nonyabidn...@hotmail.com> wrote:
> On Tue, 14 Dec 2010 15:01:29 -0500, "Zaphod Beeblebrox"
>
> <Zaphod.Arisztid.Beebleb...@gmail.com> 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

That will illicit the dreaded "Parentheses are not allowed in
subroutines" errors. It needs to either be ...

call objShell.Run("O780-A03.exe -NOPAUSE -NOREBOOT",1,True)

or

sResult = objShell.Run("O780-A03.exe -NOPAUSE -NOREBOOT",1,True)

or

objShell.Run "O780-A03.exe -NOPAUSE -NOREBOOT",1,True

However, I truly doubt either change will have any impact on the
problem, as the original line was syntactically valid, though there is
a subtle difference between it and the other three example I showed.

In the end, I really don't know why it is throwing that error; mainly
because I think it has something to do with using WSH in the Win PE
environment, which is something I know exactly nothing about.
However, I seem to remember seeing that error reported when there was
really a permissions problem. Since this is related to a Vista
install, it might have something to do with needing to elevate the
permission level of the batch procedure to "runas administrator",
though this is also something I know almost nothing about <sheepish
grin>.
__________________________
Tom Lavedas

Zaphod Beeblebrox

unread,
Dec 15, 2010, 11:42:07 AM12/15/10
to

"Tom Lavedas" <tglb...@verizon.net> wrote in message
news:5f9a0d71-bbea-4a9a...@j25g2000vbs.googlegroups.com...

Indeed, none of the above variations make any difference.

> as the original line was syntactically valid, though there is
> a subtle difference between it and the other three example I showed.

I'd be interested in what the subtle difference is - I don't even
pretend to be competent, much less expert, in vbscripting. I'm
generally pretty happy if I can get one to work at all.

> In the end, I really don't know why it is throwing that error;
> mainly
> because I think it has something to do with using WSH in the Win PE
> environment, which is something I know exactly nothing about.
> However, I seem to remember seeing that error reported when there
> was
> really a permissions problem. Since this is related to a Vista
> install, it might have something to do with needing to elevate the
> permission level of the batch procedure to "runas administrator",
> though this is also something I know almost nothing about <sheepish
> grin>.

I wonder about the permissions aspect as well, but why the script
would run at a different permissions level than a command run at the
prompt I don't know. Given that it is in a Windows PE environment, I
didn't even think there was more than the single user context - I
wouldn't know how to log in or change context if there is.

Hopefully, someone knows...

--
Zaphod

Arthur: All my life I've had this strange feeling that there's
something big and sinister going on in the world.
Slartibartfast: No, that's perfectly normal paranoia. Everyone in the
universe gets that.


Tom Lavedas

unread,
Dec 15, 2010, 11:52:55 AM12/15/10
to
On Dec 15, 11:42 am, "Zaphod Beeblebrox"
<Zaphod.Arisztid.Beebleb...@gmail.com> wrote:
> "Tom Lavedas" <tglba...@verizon.net> wrote in message

The addition of the parens around the first argument in this example
ensures that it is supplied ByVal as opposed to ByRef. As I said,
that's subtle and really makes no difference in this case.
________________________
Tom Lavedas

Zaphod Beeblebrox

unread,
Dec 15, 2010, 1:58:00 PM12/15/10
to

"Tom Lavedas" <tglb...@verizon.net> wrote in message
news:e91ef8c5-450f-4004...@m35g2000vbn.googlegroups.com...

> On Dec 15, 11:42 am, "Zaphod Beeblebrox"
> <Zaphod.Arisztid.Beebleb...@gmail.com> wrote:

<snip>


> > I'd be interested in what the subtle difference is - I don't even
> > pretend to be competent, much less expert, in vbscripting. I'm
> > generally pretty happy if I can get one to work at all.
> >
>
> The addition of the parens around the first argument in this example
> ensures that it is supplied ByVal as opposed to ByRef. As I said,
> that's subtle and really makes no difference in this case.

Thanks for the explanation, I'll keep that in mind as I work on other
projects using vbscript.

BTW, I noticed that whenever I reply to one of your posts my
newsreader (MS OE 6) doesn't add quote delimiters to the beginning of
the lines from your posts. Any ideas why that would be (other than OE
is a miserable newsreader, but is the only one allowed in our
corporate environment...)?

--
Zaphod

Voted "Worst Dressed Sentient Being in the Known Universe" for seven
years in a row.


Zaphod Beeblebrox

unread,
Dec 16, 2010, 8:20:37 AM12/16/10
to

"Zaphod Beeblebrox" <Zaphod.Ariszt...@gmail.com> wrote in
message news:ie8ier$8es$1...@news.eternal-september.org...

Well, I still don't understand why I was getting the error, but I've
at least found a workaround that allows me to move on. Instead of
copying the BIOS flash utility to X: (the RAM disk that Windows PE
creates) I had to put the BIOS flash utility on the CD file system
itself and access it through the D: drive. I'm completely clueless as
to why this worked, but if anyone else encounters this issue hopefully
this will help. In the mean time, if anyone knows why objShell.Run
reports the error when running programs from the network, and in some
cases from the RAM drive, and why placing the BIOS flash utility on
the CD file system itself works, I'd love to hear it.

--
Zaphod

Arthur Dent, speaking to Trillian about Zaphod:
"So, two heads is what does it for a girl?"
"...Anything else he's got two of?"


Dr J R Stockton

unread,
Dec 16, 2010, 4:04:11 PM12/16/10
to
In microsoft.public.scripting.vbscript message <5f9a0d71-bbea-4a9a-
8be4-8df...@j25g2000vbs.googlegroups.com>, Wed, 15 Dec 2010
05:50:29, Tom Lavedas <tglb...@verizon.net> posted:

>That will illicit

elicit, for those trying to learn English.

--
(c) John Stockton, nr London UK. ???@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.

Al Dunbar

unread,
Dec 16, 2010, 7:27:54 PM12/16/10
to

"Dr J R Stockton" <repl...@merlyn.demon.co.uk> wrote in message
news:Y5vXYFTL...@invalid.uk.co.demon.merlyn.invalid...


> In microsoft.public.scripting.vbscript message <5f9a0d71-bbea-4a9a-
> 8be4-8df...@j25g2000vbs.googlegroups.com>, Wed, 15 Dec 2010
> 05:50:29, Tom Lavedas <tglb...@verizon.net> posted:
>
>>That will illicit
>
> elicit, for those trying to learn English.

Boo! , for those trying to learn scripting and for whom the error did not
negatively affect the value of the post.

/Al

Evertjan.

unread,
Dec 17, 2010, 3:43:39 AM12/17/10
to

I would definitly elicit "cancelled" to "canceled",
making the latter illicit.

On the other hand "operation cancelling" can effectively
be counteracted by giving the proper premedication to surgery.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

0 new messages