Programmatically select multiple files in windows explorer

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

Find absolute java.exe path programmatically from java code

String javaHome = System.getProperty(“java.home”); Can you tell me either through pure Java … on windows how is it possible to find out the location of javaw.exe? E.G. import java.io.File; class JavawLocation { public static void main(String[] args) { String javaHome = System.getProperty(“java.home”); File f = new File(javaHome); f = new File(f, “bin”); f = new … Read more

Create Named Pipe C++ Windows

You cannot create a named pipe by calling CreateFile(..). Have a look at the pipe examples of the MSDN. Since these examples are quite complex I’ve quickly written a VERY simple named pipe server and client. int main(void) { HANDLE hPipe; char buffer[1024]; DWORD dwRead; hPipe = CreateNamedPipe(TEXT(“\\\\.\\pipe\\Pipe”), PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, // … Read more

Rename multiple files in cmd

Make sure that there are more ? than there are characters in the longest name: ren *.txt “???????????????????????????? 1.1.txt” See How does the Windows RENAME command interpret wildcards? for more info. New Solution – 2014/12/01 For those who like regular expressions, there is JREN.BAT – a hybrid JScript/batch command line utility that will run on … Read more