Hi There....
I am working on visual studio 2005 with c#, i am newbie actually,
I have created an application which create shortcut of an bat file(startup.bat) on the desktop which actually starts tomcat server.and it create successfully, but that shortcut is not working. if i go physically to that batch file and create shortcut from there(rightclick>Sendto>Desktop),and run it, then it executed successfully.
Pls Pls help me out from this, why this batch file is not running or do i have any other procedure to make shortcut of this batch file that run? Sorry for my english :-)
below are the code snipet that i used-
strDesktopPathForStartApache = @"C:\Documents and Settings\All Users\Desktop\DR_Start.lnk";
strForStartApache = @"C:\Program Files\DataRocket Installer\Apache Tomcat Server\bin\startup.bat";
CreateShortcut("Start Apache Tomcat Server", strDesktopPathForStartApache, strForStartApache);
private static void CreateShortcut(string Description,string DesktopPath,string srcTarget)
{
try
{
WshShell = new WshShellClass();
IWshRuntimeLibrary.IWshShortcut MyShortcut;
MyShortcut = (IWshRuntimeLibrary.IWshShortcut)WshShell.CreateShortcut(DesktopPath);
MyShortcut.TargetPath = srcTarget;
MyShortcut.Description = Description;
MyShortcut.Save();
}
catch { }
}
Thanx in advance
Regards,
Peter