tag:blogger.com,1999:blog-1078032318127767231.post7350740934256915226..comments2024-03-20T01:42:16.872-05:00Comments on Spotfire Developer: Running external programsJose Leviaguirrehttp://www.blogger.com/profile/12377756211132280060noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-1078032318127767231.post-44168041144012325962022-02-23T13:51:25.658-06:002022-02-23T13:51:25.658-06:00sorry I had a space in the file name - had to encl...sorry I had a space in the file name - had to enclose the full path in double quotes - now it worksewalkerhttps://www.blogger.com/profile/14982986519549243454noreply@blogger.comtag:blogger.com,1999:blog-1078032318127767231.post-9302946872347134682022-02-23T13:13:43.742-06:002022-02-23T13:13:43.742-06:00it works for me. My deleter.bat file is:
cd c:\te...it works for me. My deleter.bat file is:<br /><br />cd c:\temp\test<br />del *.txtJose Leviaguirrehttps://www.blogger.com/profile/12377756211132280060noreply@blogger.comtag:blogger.com,1999:blog-1078032318127767231.post-47471701988490360642022-02-23T11:19:29.684-06:002022-02-23T11:19:29.684-06:00thanks,
I created a bat file containing the del co...thanks,<br />I created a bat file containing the del command. I didn't use anything for argument and I removed that line. when I run the script, I see the cmd window coming on briefly but the txt files are not removed. If I execute that bat file in a cmd window outside of spotfire, it worksewalkerhttps://www.blogger.com/profile/14982986519549243454noreply@blogger.comtag:blogger.com,1999:blog-1078032318127767231.post-47533003951107891442022-02-23T10:34:03.107-06:002022-02-23T10:34:03.107-06:00ewalker, just create a yourdelete.bat file say in ...ewalker, just create a yourdelete.bat file say in c:\your\folder\deleter.bat and change:<br /><br />program="explorer"<br /><br />to:<br /><br />program="c:\\your\\folder\\deleter.bat"Jose Leviaguirrehttps://www.blogger.com/profile/12377756211132280060noreply@blogger.comtag:blogger.com,1999:blog-1078032318127767231.post-65976688487255733972022-02-23T10:12:24.448-06:002022-02-23T10:12:24.448-06:00I would like to delete all intermediate txt files ...I would like to delete all intermediate txt files produced in an ironpython script at the end f its execution - something like<br />DEL /Q *.txt<br />I tried putting this in "program" and "URL" but it complained that it could not find the file (DEL is a built-in DOS command and hence it doesn't exist anywhere in system or system32 folders.<br /><br />How would I set this up using this bat file approach? thanksewalkerhttps://www.blogger.com/profile/14982986519549243454noreply@blogger.comtag:blogger.com,1999:blog-1078032318127767231.post-94315873440301752017-02-22T01:16:49.549-06:002017-02-22T01:16:49.549-06:00Hello Jose,
Thanks a lot. It works now :)Hello Jose,<br /><br />Thanks a lot. It works now :)Anonymoushttps://www.blogger.com/profile/11373785211789985116noreply@blogger.comtag:blogger.com,1999:blog-1078032318127767231.post-12119724179634892042017-02-20T10:56:48.429-06:002017-02-20T10:56:48.429-06:00Hello daniel,
instead of calling cmd, you can cr...Hello daniel, <br /><br />instead of calling cmd, you can create a file.bat that contains:<br />echo %1 > %2<br /><br />on the script: <br />program='file.bat'<br />url='. blabla.txt'<br /><br />but your blabla.txt file will be created where the spotfire is setup, something like:<br />C:\Users\xxx\AppData\Local\TIBCO\Spotfire\7.6.0\Modules\Spotfire DXP Forms_25.11.10220.7834<br /><br />so it's better to put the entire path:<br />url='c:\\temp\blabla.txt'<br /><br />file.bat can also be as simple as: <br />%1<br /><br />on the script: <br />program = 'c:\\temp\\hello.bat'<br />args = 'echo.>c:\\temp\\blabla.txt'Jose Leviaguirrehttps://www.blogger.com/profile/12377756211132280060noreply@blogger.comtag:blogger.com,1999:blog-1078032318127767231.post-19212901310137636182017-02-20T09:54:20.100-06:002017-02-20T09:54:20.100-06:00Hi,
Thanks a lot for this interesting post. I hav...Hi,<br /><br />Thanks a lot for this interesting post. I have modified your code to open instead a cmd window and create an empty file "blabla.txt" using:<br /><br />program = "cmd.exe"<br />url= "/c echo.>blabla.txt"<br /><br />When I run it on Spotfire, cmd window briefly pops up but the action is not performed. Could you guess why this is not working? Thanks!Anonymoushttps://www.blogger.com/profile/11373785211789985116noreply@blogger.comtag:blogger.com,1999:blog-1078032318127767231.post-25927313118223538702016-04-06T09:51:20.827-05:002016-04-06T09:51:20.827-05:00Hello Pushpendra,
I believe that, in this partic...Hello Pushpendra, <br /><br />I believe that, in this particular case, IE launches as a thread or different process. Maybe I put a bad example here, but it was meant for illustration purposes but might be useful when dealing with non threaded processes such as 'calc' (calculator).<br /><br />WaitForExit Instructs the Process component to wait indefinitely for the associated process to exit. You can find a description to all properties and methods here:<br /><br />https://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx<br /><br />Jose Leviaguirrehttps://www.blogger.com/profile/12377756211132280060noreply@blogger.comtag:blogger.com,1999:blog-1078032318127767231.post-35990204664902870352016-04-06T04:06:10.021-05:002016-04-06T04:06:10.021-05:00I have put one more line at the end of this code:
...I have put one more line at the end of this code:<br /><br />print "IE has exited."<br /><br />And i could see that WaitForExit() returns even when IE is not exited. Although this may be because IE has it's own way to live alive after some programs start it.. not sure or WaitForExit() not working.Pushpendra Gangwarhttps://www.blogger.com/profile/04800848554423411786noreply@blogger.com