PDA

View Full Version : How to create shortcut to a command line?



peterbi
06-10-2004, 04:09 PM
Hi,

How can I create a shortcut to a command line? For example, I want to create a shortcut to command line of [INSTALLDIR]Bin directory, how can I do it?

Thanks,
Peter

peterbi
06-10-2004, 07:44 PM
I created a InstallScript CA to create the shortcut to teh command prompt. Here is the function:

function create_shortcuts(hMSI)
STRING szBinDir, szCmdPgm;

begin
szBinDir = INSTALLDIR^"Bin";

szCmdPgm = SystemFolder^"cmd.exe";

LongPathToQuote(szCmdPgm, TRUE);
AddFolderIcon(FOLDER_PROGRAMS^"MyApp", "MyApp Command Prompt", szCmdPgm, szBinDir, "", 0, "", NULL);

end;


I want the shortcut to launch command prompt to szBinDir, but it always create shortcut pointing to "c:\Documents and Settings\myid" which is the default command prompt to my pc.

Any problem with the code?

Thanks,
Peter