New topic: Shell Paths in Windows
<http://forums.realsoftware.com/viewtopic.php?t=34217> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message wcboyd Post subject: Shell Paths in WindowsPosted: Thu Jun 10, 2010 12:51 pm Joined: Tue Dec 13, 2005 7:29 am Posts: 293 Location: Little Elm, TX Hello All, I have a series of commands that I want to execute within a certain directory on Windows, but I can't seem to get it to work. Everytime I execute the command it executes it in the directory that I last opened a RB project in. VERY ODD. Here is my code: Code: Dim f as FolderItem Dim sh As Shell sh = new Shell sh.Mode = 2 If Not sh.IsRunning Then sh.Execute "cmd" End If f=SelectFolder If f<> Nil Then sh.Write "cd " + f.ShellPath If sh.ErrorCode = 0 then sh.Write "dir" IF sh.ErrorCode = 0 then TextArea1.Text = sh.ReadAll else TextArea1.Text = str(sh.ErrorCode) End If End If End If I am just using the "dir" command for testing since it is the safest and one of the more generic ones. So the question becomes how do I execute a certain command in a particular directory? _________________ Thanks, Craig -------- "Stress is the body's way of saying you have not worked enough unpaid overtime." ~ Scott Adams The Association of REALbasic Professionals http://www.arbpmembers.org/ Windows Vista, Suse 11.2, RB 2010R2 Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- 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]
