Category Archives: Operating Systems

How to Prevent Driver Updates on Windows 10

Motivation:

  • Your computer may become unstable with new drivers.
  • For instance, installing a new graphics driver could cause the screen to go black.

Solution:

Combine the three methods below for maximum effectiveness.

Method 1: Disable Automatic Driver Updates via System Settings

    • Open Control PanelSystem and SecuritySystem.
    • Click Advanced system settings (left pane).
    • Under the Hardware tab, click Device Installation Settings.
    • Select “No (your device might not work as expected)”.
    • Click Save Changes.

    Method 2: Use Group Policy Editor (Only on Pro, Enterprise, Education)

    • Press Win + R, type gpedit.msc, press Enter.
    • Navigate to:
      Computer ConfigurationAdministrative TemplatesWindows ComponentsWindows Update.
    • Double-click Do not include drivers with Windows Updates.
    • Set it to Enabled, then click OK.

    Method 3: Use Device Installation Restriction in Group Policy

    • In gpedit.msc, go to:
      Computer ConfigurationAdministrative TemplatesSystemDevice InstallationDevice Installation Restrictions
    • Enable “Prevent installation of devices that match any of these device IDs”
    • Get the device’s hardware ID:
    • Open Device Manager → right-click the device → Properties → Details tab → select Hardware Ids
    • Add the hardware ID(s) to the policy.

     

    How to Convert Windows Server 2022 from Evaluation to Full Edition

    Motivation:

    • You installed Windows Server 2022 Evalution and now want to upgrade to the full edition.
    • However, when you tried changing the product key through the Activation settings, you encountered an error.

    Solution:

    1. Open Command Prompt (Admin).
    2. Execute the command below.
      Dism /online /Set-Edition:ServerStandard /ProductKey:XXXX-XXXX-XXXXX-XXXXX-XXXXX /AcceptEula
    3. Restart your computer.
    4. Open Command Prompt (Admin) again.
    5. Execute the commands below.
      slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
      slmgr /ato

     

    How to Disable Automatic Updates on Windows Server

    Motivation:

    You have a server with Windows Server 2016. The server Windows updates are being downloaded and installed automatically. This may affect your customers’ usage. You want to disable it so that you can install Windows updates when you find most appropriate.

    Solution:
    1. Open Command Prompt (Admin).
    2. Type sconfig and press Enter.
    3. Press 5 (Windows Update Settings:), then press Enter.
    4. Press D (to select DownloadOnly option), then press Enter.
    5. Click OK button.
    6. Press 13 (Restart Server), then press Enter.
    7. Click Yes button to restart your server.

    To disable automatic reboots in inactive hours, you can try the steps below.

    1. Click Start and type Task Scheduler.
    2. Expand Task Scheduler Library >> Microsoft >> Windows .
    3. Click  UpdateOchestrator.
    4. Right-click on Reboot and select Disable.

     

    How to Set File Permissions for ASP.NET Website on Windows

    Problem:

    • You have ASP.NET website on Windows.
    • Your website application pool name is mysite.com.
    • Your website physical location is D:\inetpub\wwwroot\mysite.com.
    • Your website physical data location is D:\mysite_data.
    • Your website users cannot upload or modify website files.
    • Your website users cannot upload or modify website data files.

    Solution:

    1. Open cmd.exe as Administrator and execute the command below.

    icacls "D:\inetpub\wwwroot\mysite.com" /grant "IIS AppPool\mysite.com":(OI)(CI)F /T
    icacls "D:\mysite_data" /grant "IIS AppPool\mysite.com":(OI)(CI)F /T

    This command give full permissions against D:\inetpub\wwwroot\mysite.com  and all sub-directories and files, and against D:\mysite_data  and all sub-directories and files to mysite.com user.

    2. Alternatively you can execute the command below.

    icacls "D:\inetpub\wwwroot\mysite.com" /grant IIS_IUSRS:F /t
    icacls "D:\mysite_data" /grant IIS_IUSRS:F /t

    This command give full permissions against D:\inetpub\wwwroot\mysite.com  and all sub-directories and files, and against D:\mysite_data  and all sub-directories and files to IIS_IUSRS group.

    mysite.com user is part of the IIS_IUSRS group.

     

    How to Restart a Windows Server in a Domain Remotely

    Problem:

    You need to restart a Windows server in a domain remotely because it seems to be stuck and you cannot remotely connect to it via RDP.

    Solution:

    1. Open cmd.exe and execute 2 commands below.

    ping server_name
    shutdown /r /m \\server_name /t 0/

    2. You may get the error below.

    server_name: A system shutdown is in progress.(1115)

    3. Download and extract PSTools.

    4. Open cmd.exe and execute 3 commands below.

    cd C:\Users\admin\Downloads\PSTools
    pskill \\server_name winlogon
    pskill \\server_name TrustedInstaller

     

    How to Set File Permissions for WordPress on Ubuntu

    Motivation:

    • You have a WordPress instance on Ubuntu Nginx.
    • You want to ensure that only the Nginx process can access WordPress files.

    Procedure:

    1. View current file owner and group:
    ls -l /var/html

    The root folder should be owned by www-data user. www-data is the user that web servers like Apache and Nginx on Ubuntu use by default for their normal operation.

    2. Change file owner and group to www-data if necessary:

    sudo chown -R www-data:www-data /var/html

    3. Set minimum permissions for folders:

    cd /var/html
    sudo find . -type d -exec chmod 755 {} \; # directory permissions rwxr-xr-x

    4. Set minimum permissions for files:

    cd /var/html
    sudo find . -type f -exec chmod 644 {} \; # file permissions rw-r--r--
    

    5. Verify the changes:

    ls -l /var/html

    How to Fix Firefox No Sound Issue

    Problem:

    Your Firefox suddenly does not play any sounds.

    You have tried uninstalling and reinstalling it but the problem still persists.

    Quick Solution:

    1. Go to Windows Settings > Sound > Advanced Sound Options .
    2. Make sure Firefox is not muted or set to low volume.

    Advanced Solution:

    1. Create a Firefox account and synchronize (make a backup of) your current settings.
    2. Uninstall Firefox using Windows Apps and features.
    3. Go to %APPDATA%\Mozilla and delete Firefox folder.
    4. Open regedit.exe, search for Firefox, and delete all the keys and values that can be found. This process will take some time. Just ignore any errors that may occur when some keys or values cannot be deleted.
    5. Restart your computer.
    6. Download Firefox offline installer.
    7. Install Firefox.
    8. Log in your Firefox account and restore your settings.

     

     

    How to Determine all Ports Opened by a Program in Windows

    Motivation:

    You want to ensure that your server is not compromised by a program.

    Solution:

    1. Open cmd.exe and execute commands below. Note the program file name and one of its ports that you want to investigate further.

    netstat -a -b

    2. Execute the command below. Note the PID associated with the port that you are interested in.

    netstat -ano -p tcp

    3. Execute commands below. “1544” is the PID that you are interested in.

    netstat -ano -p tcp |find "1544"

    4. Open https://mxtoolbox.com/TCPLookup.aspx, and enter [your external IP:port], and click TCP Lookup button to check if a port is open from your server.

    5. Go to your Firewall and block the port if it should not be open to the Internet.

    How to Fix Windows Updates Issue

    Problem:

    You were applying Windows updates to a Windows server and got an error with code 0x8007000d or 0x80073701. You tried restarting your server several times but it seemed that the problem still persisted.

    0x80073701 = ERROR_SXS_ASSEMBLY_MISSING which means there are some system files are missing, which caused the update installation failure.

    Solution:

    1. Restart your server.

    2. Open Command Prompt (Admin).

    3. Execute the commands below.

    net stop wuauserv
    net stop bits
    :: Removes all files from the directory
    del /q C:\Windows\SoftwareDistribution\*
    :: Recursively removes all nested directories
    for /d %x in (C:\Windows\SoftwareDistribution\*) do @rd /s /q "%x"
    net start bits
    net start wuauserv
    control update

    4. Close the Command Prompt (Admin).

    5. Install Windows updates.

    6. Click Retry button if you encounter an error.