Launching Dyalog with Quad CMD
10 posts
• Page 1 of 1
Launching Dyalog with Quad CMD
Hi All,
I cannot get ⎕CMD to launch another Dyalog session with a workspace with an embedded space in the name in a synchronous fashion. For example:
works fine, but:
does not work.
I can get it to work using the windows scripting host Run method, no problem, which is what I am doing now, but I wondered if there is a simple way to get ⎕CMD to deal with it.
I cannot get ⎕CMD to launch another Dyalog session with a workspace with an embedded space in the name in a synchronous fashion. For example:
⎕CMD '"c:\really long path with spaces.dyalog.exe" c:\shortpathnospaces\myworkspace.dws'
works fine, but:
⎕CMD '"c:\really long path with spaces.dyalog.exe" "c:\path with spaces\myworkspace.dws"'
does not work.
I can get it to work using the windows scripting host Run method, no problem, which is what I am doing now, but I wondered if there is a simple way to get ⎕CMD to deal with it.
- paulmansour
- Posts: 420
- Joined: Fri Oct 03, 2008 4:14 pm
Re: Launching Dyalog with Quad CMD
You could use the scripting host's method "GetFile" to get a file object, then use the file object's property "ShortPath" to pass to ⎕CMD.
(Bit of a roadroller to avoid using a sledgehammer to crack a nut.)
(Bit of a roadroller to avoid using a sledgehammer to crack a nut.)
-
Phil Last - Posts: 628
- Joined: Thu Jun 18, 2009 6:29 pm
- Location: Wessex
Re: Launching Dyalog with Quad CMD
You could also use .Net which is much more reliable.
In general I found that using spaces and other "unusual" characters in filenames and folders is a bad idea. You`d think that in this day and age we should be able to but it's still a problem at times. I avoid using them.
In general I found that using spaces and other "unusual" characters in filenames and folders is a bad idea. You`d think that in this day and age we should be able to but it's still a problem at times. I avoid using them.
- DanB|Dyalog
Re: Launching Dyalog with Quad CMD
Dan wrote:You could also use .Net which is much more reliable.
From a nutcracker to a sledgehammer to a roadroller to a particle accelerator.
I agree with you Dan that using blanks is "a bad idea" 'though I thoroughly disagree that "in this day and age we should be able to". A huge mistake on MS's part.
Nevertheless I guess what we're actually looking at is a bug in the parsing of filenames in ⎕CMD. Perhaps that could be tackled.
-
Phil Last - Posts: 628
- Joined: Thu Jun 18, 2009 6:29 pm
- Location: Wessex
Re: Launching Dyalog with Quad CMD
Not so much a parsing bug in the interpreter, but rather a limitation of the underlying operating system call (cmd.exe /c); the Windows Command Processor does not allow more than one set of double quotes in a command string.
We added some details about this in the ⎕CMD section of the documentation (http://help.dyalog.com/14.0/Content/Language/System%20Functions/Execute%20Windows%20Command.htm); it's in the 14.0 documentation, but holds equally well for earlier versions of Dyalog too.
[BTW: clicking on the "Open topic with navigation" link at the top of the page brings you back into the normal online help system]
We added some details about this in the ⎕CMD section of the documentation (http://help.dyalog.com/14.0/Content/Language/System%20Functions/Execute%20Windows%20Command.htm); it's in the 14.0 documentation, but holds equally well for earlier versions of Dyalog too.
[BTW: clicking on the "Open topic with navigation" link at the top of the page brings you back into the normal online help system]
-
AndyS|Dyalog - Posts: 257
- Joined: Tue May 12, 2009 6:06 pm
Re: Launching Dyalog with Quad CMD
Isn't there a way (sure I've seen it somewhere) that we can specify the dyalog.exe in a short form using the environment variable "dyalog"? That would obviate the need for the first pair of doublequotes.
-
Phil Last - Posts: 628
- Joined: Thu Jun 18, 2009 6:29 pm
- Location: Wessex
Re: Launching Dyalog with Quad CMD
Hi Paul,
You could also use ⎕na to get the Short Path Name of the workspace.
Regards,
Vince
You could also use ⎕na to get the Short Path Name of the workspace.
⎕na 'I4 kernel32.dll|GetShortPathName* <0T >0T I4'
GetShortPathName 'C:\Program Files (x86)\Dyalog\Dyalog APL 14.0 Unicode\ws\math.dws' 255 255
43 C:\PROGRA~2\Dyalog\DYALOG~3.0UN\ws\math.dws
⎕cmd '"C:\Program Files (x86)\Dyalog\Dyalog APL 14.0 Unicode\dyalog.exe" C:\PROGRA~2\Dyalog\DYALOG~3.0UN\ws\math.dws'
Regards,
Vince
- Vince|Dyalog
- Posts: 414
- Joined: Wed Oct 01, 2008 9:39 am
Re: Launching Dyalog with Quad CMD
Thanks for all the tips.
As on old timer myself, I also generally avoid blanks in files names and dots, and even file names longer than 8 letters!
But all this stuff creeps in when you are dealing with folders created by other apps and the operating system.
As on old timer myself, I also generally avoid blanks in files names and dots, and even file names longer than 8 letters!
But all this stuff creeps in when you are dealing with folders created by other apps and the operating system.
- paulmansour
- Posts: 420
- Joined: Fri Oct 03, 2008 4:14 pm
Re: Launching Dyalog with Quad CMD
I use Dyalog to "launch" APL systems a lot, and I have been using a ⎕NA call to ShellExecute since Dyalog V7 and Windows 3.11.
In the early days, ⎕CMD used to have a lot of problems, and (due to local security restrictions) it is not an option that is currently available at one major site I support.
The main problem with a Dyalog application starting up another Dyalog system is that some routes end up having "command line length restrictions". This is especially a problem when trying to start Dyalog in development mode on a PC without Dyalog being installed, and so having to specify a large number of command line parameters, several with file names.
Good luck.
In the early days, ⎕CMD used to have a lot of problems, and (due to local security restrictions) it is not an option that is currently available at one major site I support.
The main problem with a Dyalog application starting up another Dyalog system is that some routes end up having "command line length restrictions". This is especially a problem when trying to start Dyalog in development mode on a PC without Dyalog being installed, and so having to specify a large number of command line parameters, several with file names.
Good luck.
-
ray - Posts: 221
- Joined: Wed Feb 24, 2010 12:24 am
- Location: Blackwater, Camberley. UK
Re: Launching Dyalog with Quad CMD
Maybe this? The "right" way:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx
/ T
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx
/ T
- Tomas Gustafsson
- Posts: 101
- Joined: Mon Sep 19, 2011 6:43 pm
10 posts
• Page 1 of 1
Return to Windows: GUI, COM/OLE/ActiveX
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group