Showing posts with label commands. Show all posts
Showing posts with label commands. Show all posts

Thursday, August 25, 2011

cmd variables tricks

Get the variable value with replaced part to some new string:
%variable:wildcard_string=new_string%
Get only part of the variable:
%variable:~num_chars_to_skip%
%variable:~num_chars_to_skip,num_chars_to_keep%
%variable:~num_chars_to_skip_from_start, -num_chars_to_skip_from_end%
%variable:~-num_chars_to_skip_from_end,num_chars_to_keep%
%variable:~-num_chars_to_skip_from_end,-num_chars_to_skip_from_end%
other variable substitutions can be found in the command-line reference

Sunday, January 3, 2010

Windows utils

Some command line utilities I have learnt (again).

To test the originality of the system files:
sfc /scannow


To configure power setting if the powercfg.cpl UI can not be started:
powercfg.exe