From: Chris v. M. <cva...@ne...> - 2002-12-19 20:37:55
|
Never had time to track down the reason, but I've usually found: cmd = 'cmd.exe /C SRCDIR.bat' # This works on Win98 - but not NT/W2000 Runtime.getRuntime().exec(cmd) # This works on NT/W2000 - but not Win98 os.system(cmd) - Chris > ---------- > From: kco...@cf...[SMTP:kco...@cf...] > Sent: Thursday, December 19, 2002 10:04 AM > To: jyt...@li... > Subject: [Jython-users] Can I execute a bat file from jython > > I'm working on win2K with Jython 2.1 > Is this possible? Can I execute a bat file from jython. > If so, what am I doing wrong? > > *****script**** > proc = Runtime.getRuntime().exec('cmd.exe /C SRCDIR.bat') > proc.waitFor() > brIn = BufferedReader(InputStreamReader(proc2.getInputStream())) > while 1: > line=brIn.readLine() > if not line: > break > print line > print brIn > print os.environ.get('SRCDIR') > proc.destroy() > > ***SRCDIR.bat**** > set SRCDIR=%CD% > echo > %SCRDIR% > > > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: Geek Gift Procrastinating? > Get the perfect geek gift now! Before the Holidays pass you by. > T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |