User Tools

Site Tools


archive:win32

Window$ Stuff

Things I thought I would never have to look at again but is somehow, quite consistently, forced to tinker with from time to time m(

Disclaimer: The stuffs I have here are only for my personal note (I got most of them from online resources - kudos to the original resource). If you want to try the same thing based on this, I cannot be held responsible if something goes wrong 8-).

Get 'Open Command Prompt Here' Option in Windows Explorer

  • Windows 7: Hold 'Shift' key while right-clicking on a folder in Windows explorer

Turn On or Off Guest Account in Command Prompt

In Administrator's command prompt only…

  • To Turn On the Guest Account
    net user Guest /active:yes
  • To Turn Off the Guest Account
    net user Guest /active:no

Create Linux Boot Entry on Windows using BCDEdit

  • install Linux boot loader to partition boot block
    • save image (e.g. if partition is /dev/sda3):
      dd if=/dev/sda3 of=linux.bin bs=512 count=1
    • copy this file to Windows partition (root of C: drive is best option)
  • boot into Windows (I tried this on 7)
    • we will be modifying the boot configuration data
      • to backup:
        bcdedit /export backup.bcd
      • to restore (later?):
        bcdedit /import backup.bcd
    • create an entry
      bcdedit /create /d "Linux" /application bootsector
      • note the returned identifier (ID)
    • point to partition where the image file is copied (e.g. if drive C)
      bcdedit /set [ID] device partition=c:
    • point to file with full path (e.g. if \linux.bin)
      bcdedit /set [ID] path \linux.bin
    • position entry at the end?
      bcdedit /displayorder [ID] /addlast
    • set 30s timeout, in case not set previously
      bcdedit /timeout 30
  • to delete this entry (later?)
    bcdedit /delete [ID]

More BCDEdit stuffs

On Windows 8.1 (and above?), the Windows Recovery Environment is disabled by default on UEFI systems (helps to boot faster). To get access, enable using BCDEdit:

bcdedit /set {default} bootmenupolicy legacy

To revert to original settings:

bcdedit /set {default} bootmenupolicy standard

Do note that we need to run command prompt as Administrator when doing this.

Remove Services

  • Check list of services, type
    Win+R and run 'services.msc'
  • Open a command prompt as administrator
  • To remove, type (insert double quotes if the name has any whitespace character)
    sc delete ServiceName
  • Refresh the list (F5) and it should be gone

System Event Error

I got this error:

Windows could not connect to the System Event Notification Service service...
  • open a command prompt as administrator
  • type
    netsh winsock reset
    • note: can also run this to try and fix failing to get ip address
  • restart

Using diskpart

Disk partitioning utility on Windows is diskpart (other than using GUI-based disk manager). It create MBR partition table.

e.g. To create single FAT32 partition in SD card, open command prompt as administrator and run diskpart.

  1. list all disk
    > list disk
    • identify sd card id <n>
  2. select sd card
    > select disk <n>
  3. list all available partitions
    > list part
  4. select partition id {n}
    > select part {n}
  5. remove selected partition
    > delete part
  6. repeat last two steps for each partition found
  7. create single partition
    > create part primary offset=1024
    • note offset value is in kilobytes
  8. exit and format as FAT32
archive/win32.txt · Last modified: 2023/08/29 10:43 by 127.0.0.1