Category: Development

  • Synchronizing two batch files

    This useful command lets you wait for signals from other command windows or even across the network.

    waitfor.exe is in windowssystem32 directory.

    The simple case for the tool is in one command window you do a “waitfor foobar” and it’ll block until in another window you do a “waitfor /SI foobar”.

  • Disable standby/sleep

    powercfg.exe is a windows built in tool to config power management. powercfg.exe is a command line utility, it’s easy to integrate powercfg.exe into scripts.

    Turn hibernation off

    powercfg -hibernate OFF

    Set the power configuration to High Performance

    powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

    Set the absentia power scheme (the scheme used when no one is logged in)

    powercfg.exe -setabsentia 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

  • Enable/disable the built-in administrator account

    Enabling the built-in administrator account:

    net user administrator /active:yes

    Disabling the built-in administrator account:

    net user administrator /active:no

    Note: Must use an elevated command prompt for this command to work.

  • Shutdown or reboot the computer

    Shut down

    shutdown /s /t 0

    Reboot

    shutdown /r /t 0

  • Changing the computername

    Domain joined

    netdom.exe renamecomputer %computername% /NewName:<new name> /userd:domainuser /passwordd:*

    Non-Domain joined

    wmic.exe computersystem where name="%computername%" rename name="<new name>"

  • Launch Regional and Language Settings

    Bring up the Regional and Language Settings dialog box

    control intl.cpl