How do I write a batch file which opens the GitBash shell and runs a command in the shell?
“C:\Program Files (x86)\Git\bin\sh.exe” –login -i -c “git archive master | tar -x -C $0” “%~1”
“C:\Program Files (x86)\Git\bin\sh.exe” –login -i -c “git archive master | tar -x -C $0” “%~1”
To get the target of a shortcut (.lnk file extension) you’ll need first to have the following COM object: Windows Script Host Object Model Then, you may use WshShell (or WshShellClass) and IWshShortcut interfaces to get the target of a shortcut Example string linkPathName = @”D:\Picrofo Autobot.lnk”; // Change this to the shortcut path if … Read more
This should be possible with the shell function SHOpenFolderAndSelectItems EDIT Here is some sample code showing how to use the function in C/C++, without error checking: //Directory to open ITEMIDLIST *dir = ILCreateFromPath(_T(“C:\\”)); //Items in directory to select ITEMIDLIST *item1 = ILCreateFromPath(_T(“C:\\Program Files\\”)); ITEMIDLIST *item2 = ILCreateFromPath(_T(“C:\\Windows\\”)); const ITEMIDLIST* selection[] = {item1,item2}; UINT count = … Read more
Sure, it’s located in pythoncom and shell for constants, for example: from win32com.shell import shell import pythoncom # create an instance of IFileOperation fo = pythoncom.CoCreateInstance(shell.CLSID_FileOperation, None, pythoncom.CLSCTX_ALL, shell.IID_IFileOperation) # here you can use SetOperationFlags, progress Sinks, etc. # create an instance of IShellItem for the source item item1 = shell.SHCreateItemFromParsingName(“c:\\temp\\source.txt”, None, shell.IID_IShellItem) # create … Read more
Process.Start. Note that advanced uses (printing etc) require using a ProcessStartInfo and setting the Verb property.
As ever so often Zarco Gajic has a solution: Capture the output from a DOS (command/console) Window. This is a copy from his article for future reference: The example runs ‘chkdsk.exe c:\’ and displays the output to Memo1. Put a TMemo (Memo1) and a TButton (Button1) on your form. Put this code in the OnCLick … Read more
A Raymond’s post: Do not write in-process shell extensions in managed code. A recent follow-up: Now that version 4 of the .NET Framework supports in-process side-by-side runtimes, is it now okay to write shell extensions in managed code? The bottom line is, no, it is not okay: The Guidance for implementing in-process extensions has been … Read more
Ran across this today — it’s a few months old, but it got the job done for me (on Win7, extracting thumbnails on MPEG-4 files): Source : https://github.com/dbarros/WindowsAPICodePack Nuget : https://www.nuget.org/packages/WindowsAPICodePack-Shell Code: ShellFile shellFile = ShellFile.FromFilePath(pathToYourFile); Bitmap shellThumb = shellFile.Thumbnail.ExtraLargeBitmap; Hope it helps!