The wd commands doc (Help|wd commands) explains wd parameters. In your
example you have a parmater that has " chars so you can't use "s as the wd
delimiter. Delimit such paramters with DEL (profile defined as char value
127). So your sentence should look something like:
wd 'winexec ',DEL,'cmd /C start "drive:/path to/file"',DEL,' sw_hide'
----- Original Message -----
From: "Sherlock, Ric" <[EMAIL PROTECTED]>
To: "Programming forum" <[email protected]>
Sent: Wednesday, July 11, 2007 6:43 PM
Subject: RE: [Jprogramming] Open file with associated application
Yes you're right. In fact this works too:
wd 'winexec *cmd /C "drive:/path to/file"'
The only downside is that it's not possible to give any options (such as
sw_hide) to winexec.
wd 'winexec *cmd /C start "" "drive:/path to/file" sw_hide'
I think these are interpreted as parameters to the application starting,
rather than parameters for winexec and so the cmd window displays
briefly. A bit ugly but I can live with it.
I was thinking that I could call the winapi function GetShortPathName
for my filename before I give it to:
wd 'winexec "cmd /C ',filename,'" sw_hide'
I'm struggling to get the calling syntax right though. From
win32api.dat:
kernel32 GetShortPathName i *c *c i
From MSDN:
<http://msdn2.microsoft.com/en-US/library/aa364989.aspx>
DWORD WINAPI GetShortPathName(
LPCTSTR lpszLongPath,
LPTSTR lpszShortPath,
DWORD cchBuffer
);
fln=: 'd:\Folder with spaces\File with spaces.xls'
'GetShortPathName'win32api fln;(,' ');#fln
|domain error
| 'GetShortPathName'win32api fln;(,' ');#fln
I think the bit I'm getting wrong is the 2nd parameter ... of course I
could be wrong about that too!!!
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Oleg Kobchenko
Sent: Thursday, 12 July 2007 04:15
To: Programming forum
Subject: RE: [Jprogramming] Open file with associated application
OK. According to "start" help, this should work:
wd 'winexec *cmd /c start "" "path/to/file"'
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm