New topic: Odd behaviour with Shell on Vista
<http://forums.realsoftware.com/viewtopic.php?t=29678> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message rmac Post subject: Odd behaviour with Shell on VistaPosted: Fri Aug 21, 2009 12:33 pm Joined: Fri Sep 30, 2005 11:31 am Posts: 143 Location: Helsinki, Finland I'm working on a process guardian software that monitors certain process (using ProcessMBS) and if it disappears, attempts to restart the application. On Mac OSX I could do this simply by launching ProcessMBS.Path but I'd need to get this working on Vista as well. My first approach has been using shell since the application is defined in the system path. The strange thing is when I call the application via Shell I get result message saying ''outlook.exe' is not recognized as an internal or external command,operable program or batch file.'. However, if I open cmd.exe and type 'outlook.exe' it starts the application as it should. I'm not using PowerShell on this one, just the plain old cmd.exe. I have tried this by adding the application path on environment variables as both system path and current user path. In both cases it works when user runs cmd.exe but doesn't work via the RB shell command. What is the difference between application calling app via shell in Vista and the current, non-admin user calling the app using cmd.exe? Here's the code that runs on timer's Action -event: Code:dim p as ProcessMBS p=new ProcessMBS p.GetfirstProcess dim IsRunning as boolean do if p.name=targetPath then IsRunning=true end loop until not p.GetNextProcess if not IsRunning then //attempting to restart application //assuming the application is in path dim sh as new shell sh.Execute targetPath dim c as new clipboard c.text=sh.result end Top timhare Post subject: Re: Odd behaviour with Shell on VistaPosted: Fri Aug 21, 2009 12:56 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 6163 Location: Portland, OR USA Cmd.exe DOES NOT EQUAL system Shell. Cmd.exe does a lot of extra stuff for you that a Shell does not. Use full path names in your shell. Tim Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
