Creating a file shortcut (.lnk)

One way to do this is pointed out by Joepro in their answer here: You’ll need to add a COM reference to Windows Scripting Host. As far as i know, there is no native .net way to do this. WshShellClass wsh = new WshShellClass(); IWshRuntimeLibrary.IWshShortcut shortcut = wsh.CreateShortcut( Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + “\\shorcut.lnk”) as IWshRuntimeLibrary.IWshShortcut; shortcut.Arguments = … Read more

Run a shortcut with a batch file

The help for start contains this tidbit: START [“title”] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED] [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL] [/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B] [command/program] [parameters] “title” Title to display in window title bar. In other words the first quoted string will … Read more

How to programmatically create a shortcut using Win32

Try Windows Shell Links. This page also contains a C++ example. Descriptive Snippet: Using Shell Links This section contains examples that demonstrate how to create and resolve shortcuts from within a Win32-based application. This section assumes you are familiar with Win32, C++, and OLE COM programming. EDIT: Adding the code sample in case the link … Read more

How can I launch Chrome with flags from command line more concisely?

Just make an alias in your .bashrc or .bash_profile alias ogc=”open -a Google\ Chrome –args –disable-web-security” And then reload your shell. exec $SHELL Now, every time you type ogc (or whatever you want to call it) in your terminal, it will run the full command open -a Google\ Chrome –args –disable-web-security