PDA

View Full Version : ShortCut slash problem


keki
09-17-2008, 10:45 AM
Hi
I have a problem about shortcut.
I wolud like to make a shourtcut target:
"C:\CAD\MEP 2009\acad.exe" /ld "C:\CAD\MEP 2009\AecBase.dbx" /p "AutoCAD Architecture (US Metric)"

But When I make a string, it is OK, but when Shortcut done, the target line will be:
"C:\CAD\MEP 2009\acad.exe" \ld "C:\CAD\MEP 2009\AecBase.dbx" \p "AutoCAD Architecture (US Metric)"

My question is:
How can I make "\p" or other command switch, if I use Shell.CreateShortcut built in function?

This is my code:

-- Make a target comman line
ShorCutString = "\""..DLLdir;
ShorCutString = ShorCutString.."\\acad.exe\"";
ShorCutString = ShorCutString.." /ld ";
ShorCutString = ShorCutString.."\""..DLLdir.."\\AecBase.dbx\"";
ShorCutString = ShorCutString.." /p ";
ShorCutString = ShorCutString.."\"AutoCAD MEP (HUN)\"";

Dialog.Message("This Is a String",ShorCutString); -- it is ready, and if i see the dialog, the "ShorCutString" message correct[/COLOR[COLOR="yellowgreen"]]-- Make a ShortCut with "ShorCutString" parameter, and the result will be incorrect
Shell.CreateShortcut(_DesktopFolder, "AutoCAD MEP ", ShorCutString, "", "", DLLdir.."\\MEP2009.ico", 0, SW_MAXIMIZE, nil, "MEP 2009 magyar felülettel");

Have any solution?

Regards Keki

Mark
09-17-2008, 11:04 AM
Hi keki,

When creating a shortcut using Shell.CreateShortcut() the target parameter should only be the target file. All command line options should be passed using the CmdLine parameter.

In your example you are attempting to pass command line options via the target parameter.

Try something closer to this:


-- Make a target comman line
ShorCutString = "\""..DLLdir;
ShorCutString = ShorCutString.."\\acad.exe\"";
strCommandLine = "/ld ";
strCommandLine = strCommandLine.."\""..DLLdir.."\\AecBase.dbx\"";
strCommandLine = strCommandLine.." /p ";
strCommandLine = strCommandLine.."\"AutoCAD MEP (HUN)\"";

Dialog.Message("This Is a String",ShorCutString);
Shell.CreateShortcut(_DesktopFolder
, "AutoCAD MEP "
, ShorCutString
, strCommandLine
, ""
, DLLdir.."\\MEP2009.ico"
, 0
, SW_MAXIMIZE
, nil
, "MEP 2009 magyar felülettel");