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
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
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.
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
<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.
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?"
>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.
"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
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)