Изменить место хранения профиля пользователя Windows

Взято отсюда: https://itteh.org/?p=469

1. Создайте новую папку, которая будет использоваться для хранения профилей.
2. Скопируйте все существующие профили из папки %systemdrive%\DocumentsandSettings в только что созданную папку. (Обратите внимание, что при копировании с файловой системы NTFS на файловую систему NTFS необходимо воспользоваться командой XCOPY и параметром командной строки /o, что позволит сохранить списки контроля доступа, связанные с каждым файлом.)
3. Запустите редактор системного реестра (REGEDIT.EXE) и перейдите к разделу HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\ProfileList.
4. Дважды щелкните на записи ProfileDirectory.
5. Введите путь к новой папке и щелкните на кнопке OK.

XCOPY /H /O /T /E /B /Y c:\users d:\users

Занятно, я mklink юзал, но этот вариант лучше, потому что позволяет сразу все менять. Спасибо автору :-)

Default user’s temps:
HKEY_USERS\Environment\

Default System temps:
HKLM\System\ControlSetXXX\Control\Session Manager\
HKLM\System\CurrentControlSet\Control\Session Manager\

Change environment valiables in Group Policy:

  1. Open the Group Policy Management Console . Right-click the Group Policy object (GPO) that should contain the new preference item, and then click Edit .
  2. In the console tree under Computer Configuration or User Configuration , expand the Preferences folder, and then expand the Windows Settings folder.
  3. Right-click the Environment node, point to New , and select Environment Variable .

https://technet.microsoft.com/en-us/library/cc772047(v=ws.11).aspx

Полезные команды CMD Windows + контекст .BAT файлов

Узнать модель материнской платы из cmd:

wmic baseboard get product,Manufacturer,version,serialnumber

https://x-flame.ru/kak-uznat-model-materinskoj-platy-cherez-cmd/

Узнать подробности видимых WiFi сетей:

netsh wlan show networks mode=bssid

Запустить программу из .bat файла с параметрами:<

start "" "c:\program files\Microsoft Virtual PC\Virtual PC.exe" -pc MY-PC -launch
In other words, give it an empty title before the name of the program to fake it out.

https://stackoverflow.com/questions/154075/using-the-start-command-with-parameters-passed-to-the-started-program

Save output to file:

command.name > fileName.txt

Remove text from file:

findstr /v /i /L /c:"Mabrur" text.txt >out.txt

/v means “lines that do not contain
/i means “case-insensitive”.
*all lines containing the /L literal string Mabrur, whether it is as product or some other column, or is part of a longer string will be excluded.

https://stackoverflow.com/questions/49569889/how-to-delete-some-line-from-txt-file-using-batch

Disable beep Windows 8/8.1/10/2012

net stop beep
sc config beep start= disabled

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Beep

Start = 0x00000000
HKEY_CURRENT_USER\Control Panel\Sound
beep = no

CryptoPRO 3.6 & 3.9 bug hangs TermService

Долго я бился с проблемой зависания сервера терминалов на одном сервере.

Пробелма проявляет себя так: в случайный момент сервер перестает пускать пользователей, которые подключаются по RDP. Ошибка у пользователей гласит о проблемах с сервером лицензий.  Если перезапустить TermService, то все начинает работать как надо, но опять до непредсказуемого момента.

 

Я решил это так:

Создал задание, которое при событии 20497 из источника TerminalServices-RemoteConnectionManager  лога Microsoft-Windows-TerminalServices-RemoteConnectionManager запускает следующий скрипт:

taskkill /F /FI “SERVICES eq TermService”
ping 127.0.0.1 -n 4
net start TermService /y
ping 127.0.0.1 -n 4
exit

Это, конечно, костыль страшный, но пока такой вариант единственно приемлемый на том сервере.

 

Несколько других вариантов решения проблемы, таких как отключение шифрования ГОСТ или перехода на версию КриптоПро 4.0 описаны здесь:

https://forum.ru-board.com/topic.cgi?forum=8&topic=51566&start=120#20

https://www.cryptopro.ru/forum2/default.aspx?g=posts&t=8146&p=3

 

Windows Update 80070003 error, если Server 2012 R2 не хочет обновляться

net stop wuauserv

DISM /Online /Cleanup-Image /RestoreHealth

If there is an error ” The source files could not be downloaded”:

gpedit.msc

Computer Configuration > Administrative Templates > System

Specify settings for optional component installation and component repair setting

Contact Windows Update directly to download repair content instead of Windows Server Update Service (WSUS).

or

DISM /Online /Cleanup-Image /RestoreHealth /source:WIM:X:\Sources\Install.wim:1 /LimitAccess Where “X” is the drive letter where the ISO is located. Simply change the “X” to the correct drive letter

 

sfc /scannow

shutdown /r /f

 

https://www.thewindowsclub.com/dism-fails-source-files-could-not-be-found

https://support.microsoft.com/ru-ru/help/947821/fix-windows-update-errors-by-using-the-dism-or-system-update-readiness