Jump to content
Registration disabled at the moment Read more... ×

A.M. Hoornweg

Members
  • Content Count

    495
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by A.M. Hoornweg

  1. A.M. Hoornweg

    Shellexecute cmd.exe with spaces

    ... unless you need to use pipes, environment variables or want to capture the output of a command line program into a file. Then cmd.exe is a real life saver for which there is no real alternative as far as I'm aware. I had precisely that case last week. In an installation routine (inno Setup) I needed to figure out if a set of Microsoft IIS components was installed correctly before allowing the user to continue the installation of my ISAPI webservice. The following one-liner gives that information sorted in a text file. cmd.exe /s /c dism /online /Get-Features /Format:table /English | sort >%tmp%\dismfeatures.txt (Note that on 64-bit systems, this particular example requires calling the 64-bit version of cmd.exe; The 32-bit version of cmd.exe will call the 32-bit version of dism.exe which is totally non-functional on 64-bit operating systems. Google "Wow64DisableWow64FsRedirection" for more info).
×