[Migrated content. Thread originally posted on 14 May 2003]
I am searching a way to have the path and the program that is related to the extention.
Ex.
123.DOC = C:\\Program Files\\Microsoft Office\\Office10\\WINDORD.EXE
OR
123.XLS = C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE
I now i can find in register this information but it is not what i am searching for!
You need to use the FindExecutable() Windows API call.
[Migrated content. Thread originally posted on 14 May 2003]
I am searching a way to have the path and the program that is related to the extention.
Ex.
123.DOC = C:\\Program Files\\Microsoft Office\\Office10\\WINDORD.EXE
OR
123.XLS = C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE
I now i can find in register this information but it is not what i am searching for!
Here is some sample code using the FindExecutableA Shell32.dll function:
77 WS-FILE PIC X(255) VALUE SPACES.
77 WS-DIRECTORY PIC X(255) VALUE SPACES.
77 WS-RESULT PIC X(255) VALUE SPACES.
77 WS-PROGRAM-PATH PIC X(255) VALUE SPACES.
77 WS-COMMAND-LINE PIC X(512) VALUE SPACES.
*Return value must be unsigned-long for win32.
01 RETURN-VALUE USAGE UNSIGNED-LONG.
MOVE "123.DOC" TO WS-FILE.
INSPECT WS-FILE REPLACING TRAILING SPACES BY NULLS.
MOVE "C:\\MYDOCS" TO WS-DIRECTORY.
INSPECT WS-DIRECTORY REPLACING TRAILING SPACES BY NULLS.
INSPECT WS-RESULT REPLACING TRAILING SPACES BY NULLS.
* Call the WIN32 API.
SET ENVIRONMENT "DLL-CONVENTION" TO 1.
CALL "SHELL32.DLL".
CALL "FindExecutableA" USING
WS-FILE
WS-DIRECTORY
WS-PROGRAM-PATH
RETURNING RETURN-VALUE
ON EXCEPTION CONTINUE
NOT ON EXCEPTION
STRING WS-PROGRAM-PATH DELIMITED BY NULL,
" " DELIMITED BY SIZE
WS-FILE DELIMITED BY NULL
INTO WS-COMMAND-LINE.
CANCEL "SHELL32.DLL".
[Migrated content. Thread originally posted on 14 May 2003]
I am searching a way to have the path and the program that is related to the extention.
Ex.
123.DOC = C:\\Program Files\\Microsoft Office\\Office10\\WINDORD.EXE
OR
123.XLS = C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE
I now i can find in register this information but it is not what i am searching for!
It would be nice if Acucorp can do all the work for us. E.g. if the routine "C$SYSTEM" would be enhanced to with an option to start a program that is related to the extension.
I could really use this function, because we work with Thin Client and cannot call a windows .dll (yet).
But then again, support for calling windows DLL's with the Thin Client would also be nice, because our customers want to be able to make a printscreen and that is also possible via a DLL call (See forum thread
Graphical print screen)
Does anyone else also wants this feature added to the C$SYSTEM routine or wants the Thin Client to be able to call Windows DLL's ?
[Migrated content. Thread originally posted on 14 May 2003]
I am searching a way to have the path and the program that is related to the extention.
Ex.
123.DOC = C:\\Program Files\\Microsoft Office\\Office10\\WINDORD.EXE
OR
123.XLS = C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE
I now i can find in register this information but it is not what i am searching for!
If you actually want to start the program and open the file, you should be able to just use the "start" command through C$SYSTEM.
For example, execute: start \\path\\abc.xls
This will start Excel (or whatever is associated with .xls) and load that file. "start" is a Windows command - you can type it at a Command Prompt or Start/Run also.
The original post just wanted the .exe path, not to actually start the .exe, so FindExecutable is needed in that case.
[Migrated content. Thread originally posted on 14 May 2003]
I am searching a way to have the path and the program that is related to the extention.
Ex.
123.DOC = C:\\Program Files\\Microsoft Office\\Office10\\WINDORD.EXE
OR
123.XLS = C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE
I now i can find in register this information but it is not what i am searching for!
If I have the program path and the file's path contains spaces
e.g.
CALL "C$SYSTEM" USING "C:\\Program Files\\Microsoft Office\\Office10\\WINWORD.EXE C:\\My files\\test.doc"
The message I get is:
"The document name or path is not valid (C:\\My)"
Can I open this file with "C$SYSTEM" ? I use ActiveX control now, but I would like to open it using "C$SYSTEM" routine
[Migrated content. Thread originally posted on 14 May 2003]
I am searching a way to have the path and the program that is related to the extention.
Ex.
123.DOC = C:\\Program Files\\Microsoft Office\\Office10\\WINDORD.EXE
OR
123.XLS = C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE
I now i can find in register this information but it is not what i am searching for!
You should wrap double quotes around the program path and the file path. So the call should look like this:
CALL "C$SYSTEM" USING '"C:\\Program Files\\Microsoft Office\\Office10\\WINWORD.EXE" "C:\\my files\\test.doc"'
Notice single quotes around the entire literal. Single quotes only needed for literal call, not for variable call.
So, the STRING statement in the FindExectuable() sample would change to this:
STRING '"' DELIMITED BY SIZE,
WS-PROGRAM-PATH DELIMITED BY NULL,
'"' DELIMITED BY SIZE,
" " DELIMITED BY SIZE,
'"' DELIMITED BY SIZE,
WS-FILE DELIMITED BY NULL,
'"' DELIMITED BY SIZE,
INTO WS-COMMAND-LINE
'"' is a double quote wrapped by two single quotes. You could also use hex equivalent of X"22" instead.
[Migrated content. Thread originally posted on 14 May 2003]
I am searching a way to have the path and the program that is related to the extention.
Ex.
123.DOC = C:\\Program Files\\Microsoft Office\\Office10\\WINDORD.EXE
OR
123.XLS = C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE
I now i can find in register this information but it is not what i am searching for!
Thank you Danm. It works fine!
[Migrated content. Thread originally posted on 14 May 2003]
I am searching a way to have the path and the program that is related to the extention.
Ex.
123.DOC = C:\\Program Files\\Microsoft Office\\Office10\\WINDORD.EXE
OR
123.XLS = C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE
I now i can find in register this information but it is not what i am searching for!
Actually, thank you for pointing this out. I should have thought of this when I wrote the sample code. My production code has it in there.
[Migrated content. Thread originally posted on 14 May 2003]
I am searching a way to have the path and the program that is related to the extention.
Ex.
123.DOC = C:\\Program Files\\Microsoft Office\\Office10\\WINDORD.EXE
OR
123.XLS = C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE
I now i can find in register this information but it is not what i am searching for!
Hi Administrator,
please send the following inforamtion to the User JoeD:
Hi JoeD,
you've answered:
I wrote an ActiveX control to do this. It's kind of clunky, but it works. I
wrote a control that lets me read or write files on the client. Transferring
binary data is tough - I am converting it to hex strings before writing it
to the control and then un-hexing it on the client in the control. That
doubles the transfer time.
It would be nice if this was in the thin client - one less control I have to
install on the client side.
My Question: Can you send me this Control and a sample Cobol-Program to use
this control ?
sincerly
Peter D?rrenb?cher-Alles
KISS GmbH Personalsysteme
Wellesweiler Strasse 95
66538 Neunkirchen
Deutschland
[Migrated content. Thread originally posted on 14 May 2003]
I am searching a way to have the path and the program that is related to the extention.
Ex.
123.DOC = C:\\Program Files\\Microsoft Office\\Office10\\WINDORD.EXE
OR
123.XLS = C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE
I now i can find in register this information but it is not what i am searching for!
Originally posted by JoeD
If you actually want to start the program and open the file, you should be able to just use the "start" command through C$SYSTEM.
For example, execute: start \\path\\abc.xls
This will start Excel (or whatever is associated with .xls) and load that file. "start" is a Windows command - you can type it at a Command Prompt or Start/Run also.
Thanks for the tip. I think start is not an executable, but a shell builtin. I have to start it as follows (using thin client):
add csys-desktop, csys-async, csys-compatibility,
csys-shell, csys-hidden
giving csys-flags
call "c$system" using "start abc.xls" csys-flags
csys-shell causes the command to run in a command shell and
csys-hidden causes the command line window to stay invisible. When you don't specify
csys-hidden an annoying command line window appears just before excel is executed.
Tip: This also works with URL's; when you specify 'start mailto:support@acucorp.com' a new mail message to
support@acucorp.com is generated.
[Migrated content. Thread originally posted on 14 May 2003]
I am searching a way to have the path and the program that is related to the extention.
Ex.
123.DOC = C:\\Program Files\\Microsoft Office\\Office10\\WINDORD.EXE
OR
123.XLS = C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE
I now i can find in register this information but it is not what i am searching for!
I've found start to be problematic when there are spaces in the file path. Even when I wrap double quotes around the file path. Using the short file path seems to work, but this may not always be available to you and may require another API call to resolve long path to a short path. Has anyone got around this problem with start?
does not work:
start c:\\my file\\test.txt
start "c:\\my file\\test.txt"
does work:
start c:\\myfile~1\\test.txt
This is on win xp, haven't tried other win o/s. Any ideas?
[Migrated content. Thread originally posted on 14 May 2003]
I am searching a way to have the path and the program that is related to the extention.
Ex.
123.DOC = C:\\Program Files\\Microsoft Office\\Office10\\WINDORD.EXE
OR
123.XLS = C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE
I now i can find in register this information but it is not what i am searching for!
Looks like the /D switch works with wrapping the path in double quotes.
this works:
start /d"c:\\my files" test.txt
Now, the only test left is all windows flavors, ie. win98/me/nt/xp
Anyone know if they all support start and the /D switch?
[Migrated content. Thread originally posted on 14 May 2003]
I am searching a way to have the path and the program that is related to the extention.
Ex.
123.DOC = C:\\Program Files\\Microsoft Office\\Office10\\WINDORD.EXE
OR
123.XLS = C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE
I now i can find in register this information but it is not what i am searching for!
Phew! Ok, there's an easiar way -
For Win 95/98/ME:
start "filepath"
for WinNT/2000/XP:
start "title" "filepath"
No need for the /D switch.
:)
[Migrated content. Thread originally posted on 14 May 2003]
I am searching a way to have the path and the program that is related to the extention.
Ex.
123.DOC = C:\\Program Files\\Microsoft Office\\Office10\\WINDORD.EXE
OR
123.XLS = C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE
I now i can find in register this information but it is not what i am searching for!
One of Acucorp's customers discovered that opening a .doc in MS Word with this syntax resulted in a significant delay (caused by the Windows OS 'wait' code).
An easy workaround for this problem is to add CSYS-ASYNC to the flag value. This avoids the extra wait time that Windows uses and opens the document in MS Word immediately.
For instance, this command:
CALL "C$SYSTEM" USING "start test.doc", 64
becomes
CALL "C$SYSTEM" USING "start test.doc", 65
[Migrated content. Thread originally posted on 14 May 2003]
I am searching a way to have the path and the program that is related to the extention.
Ex.
123.DOC = C:\\Program Files\\Microsoft Office\\Office10\\WINDORD.EXE
OR
123.XLS = C:\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE
I now i can find in register this information but it is not what i am searching for!
Actually, earliar in this message thread, mathlenar posted a good code example of the flags to use with c$system when running the windows start commnd. Here's a review:
add csys-desktop, csys-async, csys-compatibility,
csys-shell, csys-hidden
giving csys-flags
call "c$system" using "start abc.xls" csys-flags