C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,223 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am trying to create a Shortcut .lnk file for a file. but I unable to set the target path. this is my target path C:\TeklaStructures\2020.0\nt\bin\TeklaStructures.exe -I "C:\TeklaStructures\DowFirm\TS2020\Imperial\EngBypass.ini" "C:\TeklaStructures\NewModel"
this is my code
WshShell wsh = new WshShell();
IWshShortcut MyShrotcut = (IWshShortcut)wsh.CreateShortcut(ModelLinkFile);
MyShrotcut.TargetPath = "C:\TeklaStructures\2020.0\nt\bin\TeklaStructures.exe -I \"C:\TeklaStructures\DowFirm\TS2020\Imperial\EngBypass.ini\" \"C:\TeklaStructures\NewModel\"";
MyShrotcut.Save();
Thanks in advance.
Anilkumar
Try this string:
MyShrotcut.TargetPath = @"C:\TeklaStructures\2020.0\nt\bin\TeklaStructures.exe -I ""C:\TeklaStructures\DowFirm\TS2020\Imperial\EngBypass.ini"" ""C:\TeklaStructures\NewModel""";
Also check this:
MyShrotcut.TargetPath = @"C:\TeklaStructures\2020.0\nt\bin\TeklaStructures.exe";
MyShortcut.Arguments = @"-I ""C:\TeklaStructures\DowFirm\TS2020\Imperial\EngBypass.ini"" ""C:\TeklaStructures\NewModel""";