Today I will present you small and neat technique that will allow us to expand command power of macros without using comparatively heavyweight and 3rd-party-dependent AutoIt scripts (you are forced to store 2 files in extension package as well as to have AutoIt installed to recompile scripts if needed).
It will be great if we could replace all that stuff with universal and compact command line 'framework' isn't it?!
And what are you thinking? I have investigated such a 'framework'!
Well. No more empty words.
There are 2 beautiful apps out there.
First is NirCMD
: powerful command-line processor able to make numerous useful things for us.
Just look at its syntax and commands list
and sure you'll be impressed with all the possibilities!
It's only drawback is its 'consoleness' it works in CMD-window and you know it isn't good thing in user's eyes. Blinking black window... Brrrrr...
Here the next app goes. CHP (Create Hidden Process)
is a program to silently launch GUI and console apps in a hidden window.
So we can simply cascade both apps in one command - and get WINDOWLESS operations being processed!
The tutorial itself
, open archive and take only 1 file - nircmdc.exe
. This is console version of utility that is most suitable for operating from kmm exec
Place this file (once again - nircmdC.exe
. Not nircmd.exe
!!!) in tools
subfolder of KM.
Download CHP and place in the same folder.
When creating macros define 2 variables:
It worth to make them global as they will be used by a number of future or rewritten macros.
Look at this template statement:
exec($CHPpath." ".$NIRpath." closeprocess ultrasurf");
this one silently closes Ultrasurf, for example, in my test macro. (instead of using system taskkill
command that is not universal across different Windows - particularly XP has other command instead)
Just playing with NirCMD commands I've created and tested (all works!) such a commands like:
exec($CHPpath." ".$NIRpath." urlshortcut \"http://www.nirsoft.net\" \"~$folder.desktop$\" \"NirSoft\" ");
(creates URL-shortcut to NirSoft homepage on your desktop)
exec($CHPpath." "."powercfg /x -monitor-timeout-ac 0");
(forces monitor never to switch off when AC-powered - changes current
So you are welcome folks to play with!
This 'framework' is able to do a big work earlier relying on AutoIt: make changes in Registry, run and close (kill) processes, work with windows, emulate keypresses, copy-paste data, create shortcuts, set system wide timers, manage logoffs/shutdowns and much more!
We'll be able to make KM real control center for our PC!
Latest Release KM75.1 Latest dev KM76RC
||| Visit The K-Meleon Place
and join me there!
Old good stuff: KM-1.6db+NS
© dugbugoffice // KM-16-S2014
© Fred // KM-1.6beta2.6
© JamesD // KM Twin+ © rodocop
// KM 220.127.116.11
RECOMMENDED! K-Meleon 76 Pro
==» Download portable: 7zip
=//= Discuss on forum
K-Meleon 75.1 Pro
|| Portable Flash plugin (x86/x64 DLLs)
Edited 3 time(s). Last edit at 11/14/2017 07:39PM by rodocop.