Ahh, you know, I think you'll need to include quotes around the entire path when you pass it in; just as you have to put quotes around a path in some places in windows.
this means you'll have to add quotes to the string you're building to execute. You can do that like this: myPath = """c:\a path with spaces""" this will put a quote as the first and last character in the string. hth, Chip -----Original Message----- From: BT [mailto:[email protected]] Sent: Wednesday, June 22, 2011 10:14 PM To: [email protected] Subject: Re: Shell In Script Hi chip, Yes, as I had just said, the runas only places a security thing up which may be for Vista and maybe windows 7, I have neither, so I don't know but suspect that is why you added it. Now, the ShellExecute does work for running the program but the parms are not getting in. Now, the Recordandplay.exe or RecordAndPlay.exe program works and even plays back the file recorded. but, it is no where to be found. Attempting to pass in the path and I did. I got it to display part of it in the prompt message but the entire path is not being displayed, so have no clue to where it is going. It is going to the documents folder but what sub folder I don't know. All I know is it works with the execute, but can not find the file. bruce Sent: Wednesday, June 22, 2011 9:32 PM Subject: RE: Shell In Script Yes; my one idea is that WE isn't doing anything to the parms. as I said earlier, use a different object's run method if you're having troubles with this one, and you're sure you have the path correct. the one I sent you will work fine. Chip -----Original Message----- From: BT [mailto:[email protected]] Sent: Wednesday, June 22, 2011 6:11 PM To: [email protected] Subject: Re: Shell In Script 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
