Hi Again,
I got the errors down to just one thing, it can not find the file.
I took out everything but the actual .exe file and it says it can not
find it.
the pathtowav is the client information path with the "\" added at the end.
Dim ReturnCode: ReturnCode = WshShell.Run( clientPathToWav &
"RecordAndPlayWav\RecordAndPlay.exe", winType, True)
Now, the only thing that could be going wrong is how WE processes all
the parms in the field.
Any ideas?
Bruce
Sent: Wednesday, June 22, 2011 3:48 PM
Subject: Re: Shell In Script
Chip,
Below is the script that works inside the default directory. But WE does
not like calling an external script. I placed this inside the app and dies
at the point of calling the run...
I looked at the external suggestion you made last night but have not
tested it yet. Was not sure of all the parms to pass in yet.
Below uses all the parms I pass in, but as I said, don't need to play
back and would not need to pass in any more than the file name. winType of 3
allows keyboard interaction and True is for waiting until script is done...
Bruce
Dim wintype: winType = 3
'3 Activates the window and displays it as a maximized window.
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
Dim ReturnCode: ReturnCode = WshShell.Run(
"RecordAndPlayWav\RecordAndPlay.exe Test.Wav 3", winType, True)
Set WshShell = Nothing
Set winType = Nothing
Set ReturnCode = Nothing
Sent: Wednesday, June 22, 2011 3:28 PM
Subject: Re: Shell In Script
Hi Chip,
I was looking at the Burn to CD and it uses the Homer stuff. Does that
also fail in Vista? Knowing that Vista liked to destroy everything...
I wrote a simple record and play routine in Python. It needs no prompt,
just pass into it the file name and if you want to also play back, but I can
also have 2 executables for that, but playsound would be the one to use at
that point...
So, no prompt needed, just to pass in a file name, but can also have an
input statement inside the record instead of passing in the name.
I already have a .vbs file that can do all of that, but WE does not like
external scripts. That uses the run method with the option for window opened
full size to allow the use of keys to stop record and exit. But, it is an
external script.
No big deal, but an option for an option to record wav files.
Bruce
Sent: Wednesday, June 22, 2011 9:38 AM
Subject: RE: Shell In Script
Hi Bruce,
you can look at either wScript.shell or shell.application, depending on what
you need.
If you need to run an executable command, and you'd like that command to not
fail in Vista/win 7, but to use the UAC prompt if necessary, have a look at
the lines below which I use in one of my apps to do this:
Set loShell = CreateObject("Shell.Application")
Speak "Now running the WSRMacros installation program."
loShell.ShellExecute fileName, "/passive", "", "runas"
It's the "runas" parameter which allows UAC to prompt the user.
hth,
Chip
-----Original Message-----
From: BT [mailto:[email protected]]
Sent: Tuesday, June 21, 2011 9:23 PM
To: [email protected]
Subject: Shell In Script
Hi!
One question, what is used to do a shell command in script?
bruce