Showing posts with label CMD. Show all posts
Showing posts with label CMD. Show all posts

Thursday, October 23, 2014

CMD title %userdomain%\%username%

When administering multiple domains, forests often have to run a command line CMD from different users. Previously, I always confused: what CMD from which user is running? Then came the idea to sign the title of the CMD command line username and domain. This can be done as follows:
1. Create or modify a registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor" AutoRun (REG_SZ)
2. Add to the value of the command @title %userdomain%\%username%

for example, this can be done by running the command
reg add "HKLM\SOFTWARE\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "@title "%""userdomain%\%""username%"" /f


Monday, September 29, 2014

Balon file for reservation disk space

Often there are situations when the free space on the disk runs out and we miss this moment :) So I suggest to use Balon file occupies 1 GB, and in the event of a critical situation with free space, delete the file. To do this, create a folder on the target disk RESERVE, in the folder, create and run a CMD file:

@echo off
IF NOT EXIST "%~dp0\safesize.rez" fsutil file createnew "%~dp0\safesize.rez" 1024000000
Download rezerve.cmd

Tuesday, August 26, 2014

Quick release system disk windows 2008 by "System queued Windows Error Reporting" and "Service Pack Backup Files"

In Windows 2008 quickly running out of space on the system drive. Servers Windows 2003 was a wonderful tool Disk Cleanup, but unfortunately in Windows 2008, you must additionally install this utility as components Desktop Experience and restart the server after installation, what happens is unacceptable. This gave the idea to create a small script for the prompt release of the system drive. In this scenario, removed "System queued Windows Error Reporting" and "Service Pack Backup Files". Running this script will free the system drive without restarting the server!

Download sys_disk_cleanup.cmd

@Echo off

if exist "%programdata%\microsoft\windows\wer\reportqueue" RD /S /Q "%programdata%\microsoft\windows\wer\reportqueue\" && MD "%programdata%\microsoft\windows\wer\reportqueue\"

dism /online /cleanup-image /spsuperseded