Macro utilizing STARTAPP

Macro utilizing STARTAPP

Anonymous
Not applicable
878 Views
5 Replies
Message 1 of 6

Macro utilizing STARTAPP

Anonymous
Not applicable

There may be a much easier way to acheive this simple task, and, if there is, I am certainly open to suggestions. I am trying to create a macro that will open up an image file (i.e. - a type of quick help file) using Windows Paint. I had rather use the Windows Image Viewer but it seems to be a bit more complicated since it has to use the rundll32.exe to start the program. The code I am using is listed below but it does not work. However, I can type in the same code at the command line, with the exception of using forward slashes in my source file path, and it works perfectly. Once I got it to work from the command line, I simply copy/paste it to my menu macro and changed the back slashes to forward slashes in the sourse file path, since AutoCAD looks at a backslash as a "pause" in a macro, but the macro will does not work. The code info I have been using is as follows:

 

Command line code that works: (startapp "c://windows/system32/mspaint.exe" "m:\\quickhelps\\qh-end-conditions.jpg")

 

Macro code that does not work: (startapp "c://windows/system32/mspaint.exe" "m://quickhelps//qh-end-conditions.jpg")

 

Many thanks for the assistance!

0 Likes
Accepted solutions (1)
879 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

use 2 backslashes or only 1 forward slash


(startapp "c:/windows/system32/mspaint.exe" "m:/quickhelps/qh-end-conditions.jpg")

0 Likes
Message 3 of 6

Anonymous
Not applicable

Sorry mracad! That did not seem to solve the problem. I used the single forward slashes since backslashes in a macro are looked at as a "pause" for user input. Any other ideas?

0 Likes
Message 4 of 6

hmsilva
Mentor
Mentor
Accepted solution

Hi rayf-man1967,

 

maybe something like this will do the trick...

 

(startapp "mspaint.exe" (findfile "m:/quickhelps/qh-end-conditions.jpg"))

 

 

Hope this helps,
Henrique

EESignature

Message 5 of 6

Anonymous
Not applicable

Worked perfectly! Many thanks!

0 Likes
Message 6 of 6

hmsilva
Mentor
Mentor

@Anonymous wrote:

Worked perfectly! Many thanks!


You're welcome, rayf-man1967!
Glad I could help

Henrique

EESignature

0 Likes