- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Can JMP call a DOS Exe
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can JMP call a DOS Exe
e.g.
web("bob.exe");
I just tried it with a perl script and it worked, too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can JMP call a DOS Exe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can JMP call a DOS Exe
1) Connect to SAS using File->SAS->Server Connections
2) Write a JSL script:
------------
conn = CurrentSASConnection();
code = EvalInsert(
"\[
X '"C:\Program Files\Microsoft\Office12\EXCEL.EXE"'
\]");
SAS Submit(code);
---------------------
That would open up Excel using a DOS command through running SAS in the background.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can JMP call a DOS Exe
e.g.
web("bob.exe");
I just tried it with a perl script and it worked, too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can JMP call a DOS Exe
However, the path must be in URL-style, like web("file:///Applications/JMPtest.scpt"), at least on the Mac.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can JMP call a DOS Exe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can JMP call a DOS Exe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can JMP call a DOS Exe
For example, if you specify a path to your .gif or .bmp image file, the image will be opened up (externally of JMP) using your default image viewer. A .bat file will be executed from a DOS shell (you will probably see a quick flash and disappearance of the black DOS shell window).
So you can write a .bat file to execute any DOS command, and call the .bat file from your JSL script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can JMP call a DOS Exe
as deeper info to anyone interested:
it works, but in this way you can't pass parameters to the bat file.
Also it seems to execute it in a directory that could be different from the one in which the script is: I had some strange behaviour, but I had cmd.exe open and I didn't pursue it further since I changed my approach, maybe it was only a glitch or my fault.
anyway, if for someone these are issues (like for me) i recommend to create and execute the bat file from inside the jsl:
riga1 = "@echo off";
riga2 = "\!Ncd C:\Users\JRR\Documents\sandbox\v2.2_bat";
riga3 = "\!Ndir>urano.txt";
Save Text File( "test_batch_write_file_selfmade.bat", riga1, mode ("replace"));
Save Text File( "test_batch_write_file_selfmade.bat", riga2, mode ("append"));
Save Text File( "test_batch_write_file_selfmade.bat", riga3, mode ("append"));
open ("test_batch_write_file_selfmade.bat")
in this way you can create a hardwired bat file using variables from jmp, and be sure on where it will be executed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can JMP call a DOS Exe
I would also like to point out the use of \!N in dghidoni's example.
compare:
SaveTextFile( "C:\Temp\cmddir.bat", "echo \!"directory list\!"\!N
dir\!N
pause\!N", mode("replace")) ;
to
SaveTextFile( "C:\Temp\cmddir.bat", "echo \!"directory list\!"
dir
pause", mode("replace")) ;
The first one (with \!N) works, the second one doesn't. Your text editor may not display the difference. But if you run cmd.exe and then type:
cd c:\temp
type cmddir.bat
you will see the difference.