Auto start vnc server (without login) on Ubuntu

1. sudo apt-get install tightvncserver

2. /usr/bin/tightvncserver (will ask for password 2 times)

3. sudo nano ~/.vnc/xstartup
example:

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession

4. sudo nano /etc/init.d/vncserver

5. put this code :

#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          vncserver
# Required-Start:    networking
# Default-Start:     3 4 5
# Default-Stop:      0 6
### END INIT INFO

PATH=”$PATH:/usr/X11R6/bin/”

# The Username:Group that will run VNC
export USER=”my_username”
#${RUNAS}

# The display that VNC will use
DISPLAY=”1″

# Color depth (between 8 and 32)
DEPTH=”16″

# The Desktop geometry to use.
#GEOMETRY=”<WIDTH>x<HEIGHT>”
#GEOMETRY=”800×600″
GEOMETRY=”1024×768″
#GEOMETRY=”1280×1024″

# The name that the VNC Desktop will have.
NAME=”my-vnc-server”

OPTIONS=”-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}”

. /lib/lsb/init-functions

case “$1” in
start)
log_action_begin_msg “Starting vncserver for user ‘${USER}’ on localhost:${DISPLAY}”
su ${USER} -c “/usr/bin/vncserver ${OPTIONS}”
;;

stop)
log_action_begin_msg “Stoping vncserver for user ‘${USER}’ on localhost:${DISPLAY}”
su ${USER} -c “/usr/bin/vncserver -kill :${DISPLAY}”
;;

restart)
$0 stop
$0 start
;;
esac

exit 0

6. sudo chmod +x /etc/init.d/vncserver

7. sudo update-rc.d vncserver defaults 99

8. reboot or run sudo /etc/init.d/vncserver start

How to See and Read Only the “SFC” Scan Results from the CBS.LOG

When SFC runs, it logs it’s actions into the C:\Windows\Logs\CBS\CBS.log. The steps in this option will show you how to see only the specific SFC entries with the [SR] tags in this CBS.log. This can be helpful to show you what files SFC could not fix automatically if you wanted to try and manually replace them.

1. Open a elevated command prompt (right click -> Run as administrator).

2. In the elevated command prompt, copy and paste the command below and press Enter.

findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfcdetails.txt"

NOTE: This will place a sfcdetails.txt file on your desktop with only the SFC scan result details from the CBS.LOG in it.

3. Close the elevated command prompt.

4. Open the sfcdetails.txt file on your desktop to see the SFC scan details in the CBS.LOG.

5. You can safely delete the sfcdetails.txt file afterwards if you like.

Windows 7 – Extract Files from Windows 7 Installation DVD

This will show you how to extract original files from the retail Windows 7 installation DVD. You can then use these extracted files to replace missing or corrupted system files in your current Windows 7 installation.

Normally you will find out that you have corrupted system files that cannot be repaired after your run a sfc /scannow command and look at it’s log report.

Here’s How:

1. Download and install the same free 32-bit or 64-bit 7-Zip program version as your 32-bit or 64-bit Windows 7.

2. Use Compatibiliy Mode on the 7-Zip shortcut and check the Run this program as an administrator box.

3. Run 7-Zip, then click on Tools and Options. Next, click on the Select all button and on OK.

4. Insert your retail Windows 7 installation disc into the DVD drive and wait for it to be recognized.

5. In 7-Zip, navigate to your DVD drive letter (ex: E: ) that has the Windows 7 installation disc in it, and double click on the Sources folder.

6. Scroll down and double click on the install.wim file.

7. You will now see this for a few seconds as it opens.

8. Each numbered folder is a different edition of Windows 7. They will vary depending on what type of Windows 7 installation DVD you have. To see what edition is for each numbered folder, select the 1.xml file and click on the Extract button on the toolbar.

9. Copy the 1.xml file to your desktop.

10. Open the 1.xml file on the desktop. Look for the <IMAGE INDEX=”#“> entry and the<NAME>edition</NAME> entry a bit under it in the code (highlighted in red below) to see what Windows 7 edition is for each numbered folder in step 8. (See code box below with an example 1.xml file)
NOTE: This file will open in Internet Explorer by default.

<PRODUCTNAME>Microsoft® Windows® Operating System</PRODUCTNAME>
  <EDITIONID>HomePremium</EDITIONID>
  <INSTALLATIONTYPE>Client</INSTALLATIONTYPE>
  <HAL>acpiapic</HAL>
  <PRODUCTTYPE>WinNT</PRODUCTTYPE>
  <PRODUCTSUITE>Terminal Server</PRODUCTSUITE>
- <LANGUAGES>
  <LANGUAGE>en-US</LANGUAGE>
  <DEFAULT>en-US</DEFAULT>
  </LANGUAGES>
- <VERSION>
  <MAJOR>6</MAJOR>
  <MINOR>1</MINOR>
  <BUILD>7600</BUILD>
  <SPBUILD>16385</SPBUILD>
  <SPLEVEL>0</SPLEVEL>
  </VERSION>
  <SYSTEMROOT>WINDOWS</SYSTEMROOT>
  </WINDOWS>
  <NAME>Windows 7 HOMEPREMIUM</NAME>
  <DESCRIPTION>Windows 7 HOMEPREMIUM</DESCRIPTION>
  <FLAGS>HomePremium</FLAGS>
  <HARDLINKBYTES>4931998179</HARDLINKBYTES>
  <DISPLAYNAME>Windows 7 Home Premium</DISPLAYNAME>
  <DISPLAYDESCRIPTION>Windows 7 Home Premium</DISPLAYDESCRIPTION>
  </IMAGE>
- <IMAGE INDEX="3">
  <DIRCOUNT>13625</DIRCOUNT>
  <FILECOUNT>64487</FILECOUNT>
  <TOTALBYTES>11910752928</TOTALBYTES>
- <CREATIONTIME>
  <HIGHPART>0x01CA0446</HIGHPART>
  <LOWPART>0xE89FF88A</LOWPART>
  </CREATIONTIME>
- <LASTMODIFICATIONTIME>
  <HIGHPART>0x01CA045F</HIGHPART>
  <LOWPART>0x79D2BCF7</LOWPART>
  </LASTMODIFICATIONTIME>
- <WINDOWS>
  <ARCH>9</ARCH>
  <PRODUCTNAME>Microsoft® Windows® Operating System</PRODUCTNAME>
  <EDITIONID>Professional</EDITIONID>
  <INSTALLATIONTYPE>Client</INSTALLATIONTYPE>
  <HAL>acpiapic</HAL>
  <PRODUCTTYPE>WinNT</PRODUCTTYPE>
  <PRODUCTSUITE>Terminal Server</PRODUCTSUITE>
- <LANGUAGES>
  <LANGUAGE>en-US</LANGUAGE>
  <DEFAULT>en-US</DEFAULT>
  </LANGUAGES>
- <VERSION>
  <MAJOR>6</MAJOR>
  <MINOR>1</MINOR>
  <BUILD>7600</BUILD>
  <SPBUILD>16385</SPBUILD>
  <SPLEVEL>0</SPLEVEL>
  </VERSION>
  <SYSTEMROOT>WINDOWS</SYSTEMROOT>
  </WINDOWS>
  <NAME>Windows 7 PROFESSIONAL</NAME>
  <DESCRIPTION>Windows 7 PROFESSIONAL</DESCRIPTION>
  <FLAGS>Professional</FLAGS>
  <HARDLINKBYTES>4804037542</HARDLINKBYTES>
  <DISPLAYNAME>Windows 7 Professional</DISPLAYNAME>
  <DISPLAYDESCRIPTION>Windows 7 Professional</DISPLAYDESCRIPTION>
  </IMAGE>
- <IMAGE INDEX="4">
  <DIRCOUNT>13655</DIRCOUNT>
  <FILECOUNT>64636</FILECOUNT>
  <TOTALBYTES>12070211908</TOTALBYTES>
- <CREATIONTIME>
  <HIGHPART>0x01CA0446</HIGHPART>
  <LOWPART>0xE89FF88A</LOWPART>
  </CREATIONTIME>
- <LASTMODIFICATIONTIME>
  <HIGHPART>0x01CA045F</HIGHPART>
   <LOWPART>0x97ECC597</LOWPART>
  </LASTMODIFICATIONTIME>
- <WINDOWS>
  <ARCH>9</ARCH>
  <PRODUCTNAME>Microsoft® Windows® Operating System</PRODUCTNAME>
  <EDITIONID>Ultimate</EDITIONID>
  <INSTALLATIONTYPE>Client</INSTALLATIONTYPE>
  <HAL>acpiapic</HAL>
  <PRODUCTTYPE>WinNT</PRODUCTTYPE>
  <PRODUCTSUITE>Terminal Server</PRODUCTSUITE>
- <LANGUAGES>
  <LANGUAGE>en-US</LANGUAGE>
  <DEFAULT>en-US</DEFAULT>
  </LANGUAGES>
- <VERSION>
  <MAJOR>6</MAJOR>
  <MINOR>1</MINOR>
  <BUILD>7600</BUILD>
  <SPBUILD>16385</SPBUILD>
  <SPLEVEL>0</SPLEVEL>
  </VERSION>
  <SYSTEMROOT>WINDOWS</SYSTEMROOT>
  </WINDOWS>
  <NAME>Windows 7 ULTIMATE</NAME>
  <DESCRIPTION>Windows 7 ULTIMATE</DESCRIPTION>
  <FLAGS>Ultimate</FLAGS>
  <HARDLINKBYTES>4963044302</HARDLINKBYTES>
  <DISPLAYNAME>Windows 7 Ultimate</DISPLAYNAME>
  <DISPLAYDESCRIPTION>Windows 7 Ultimate</DISPLAYDESCRIPTION>
  </IMAGE>
  </WIM>

11. Now open the numbered folder  that is the same edition as your currently installed Windows 7 edition, and navigate to the Windows\System32 folder. You can now select and extract the system files that you need to your desktop.

12. Verify that each extracted file is unblocked. You can now use the extracted files to copy and replace your missing or corrupted system files in your currently installed Windows 7.

You will need to take ownership and set permissions to “Allow” your account “Full Control” of the original file in your current installation before you will be allowed to replace it with the extracted copy.

If the system file is in use and you are unable to replace it with the extracted copy, then:

  • Open a Command Prompt at boot.
  • Type in the command below to copy and replace the original file with the extracted replacement file.

Copy /Y “full path of extracted replacement file” “full path of original Windows 7 system file

For example:
If the extracted replacement uDWM.DLL is on my desktop, then I would use type this in the command prompt at boot and press enter.

Copy /Y “C:\Users\User-name\Desktop\uDWM.dll” “C:\Windows\System32\uDWM.dll”

 

 

How to Run the System File Checker (Sfc.exe) Offline in Windows 7 and Vista

The System File Checker (sfc.exe) is an useful tool that lets you scan the integrity of Windows system files, and repair corrupt or missing system files. Numerous cases have been resolved thus far by running Sfc.exe with the “scannow” parameter. However, there are situations where in a corrupt or missing system file prevents Windows from booting normally, and running Sfc.exe from Windows isn’t possible. In such cases, Sfc.exe can be run offline using two additional parameters, via the Windows Recovery Environment (Windows RE) in Windows 7 and Windows Vista.

Configure the boot order in the BIOS such that the first boot device is your CD/DVD drive.

Insert the Windows 7/Vista Setup DVD and restart the computer.

Alternately, you may use the Windows 7/Vista System Repair Disc if you have one.

When prompted, press a key to boot from the DVD. In the “Install Windows” screen, click Repair your computer

Select your Windows installation, and click Next

Make a note of the drive-letter of your Windows 7 installation, as seen from Windows RE. This is the drive-letter you want to reference when running Sfc.exe offline.

Click Command Prompt

To scan the integrity (and repair) a specific file, use this command:

sfc /scanfile=d:\windows\system32\zipfldr.dll /offbootdir=d:\ /offwindir=d:\windows

The above command scans the file zipfldr.dll and replaces it if required.

To scan the integrity of all system files and repair them, run this command:

sfc /scannow /offbootdir=d:\  /offwindir=d:\windows

This process takes some time (<5 min in my case) to complete, and there weren’t any integrity violations.

How to restore the system/boot drive letter in Windows

Warning Do not use the procedure that is described in this article to change a drive on a computer where the drive letter has not changed. If you do so, you may not be able to start your operating system. Follow the procedure that is described in this article only to recover from a drive letter change, not to change an existing computer drive to something else. Back up your registry keys before you make this change.

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

249321  Unable to log on if the boot partition drive letter has changed

This article describes how to change the system or boot drive letter in Windows. For the most part, this is not recommended, especially if the drive letter is the same as when Windows was installed. The only time that you may want to do this is when the drive letters get changed without any user intervention. This may happen when you break a mirror volume or there is a drive configuration change. This should be a rare occurrence and you should change the drive letters back to match the initial installation.

To change or swap drive letters on volumes that cannot otherwise be changed using the Disk Management snap-in, use the following steps.

Note In these steps, drive D refers to the (wrong) drive letter assigned to a volume, and drive C refers to the (new) drive letter you want to change to, or to assign to the volume.

This procedure swaps drive letters for drives C and D. If you do not need to swap drive letters, simply name the \DosDevice\letter: value to any new drive letter not in use.

 

Change the System/Boot Drive Letter

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:

322756  How to back up and restore the registry in Windows
  1. Make a full system backup of the computer and system state.
  2. Log on as an Administrator.
  3. Start Regedt32.exe.
  4. Go to the following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices
  5. Click MountedDevices.
  6. On the Security menu, click Permissions.
  7. Verify that Administrators have full control. Change this back when you are finished with these steps.
  8. Quit Regedt32.exe, and then start Regedit.exe.
  9. Locate the following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices
  10. Find the drive letter you want to change to (new). Look for “\DosDevices\C:”.
  11. Right-click \DosDevices\C:, and then click Rename.

    Note You must use Regedit instead of Regedt32 to rename this registry key.

  12. Rename it to an unused drive letter “\DosDevices\Z:”.

    This frees up drive letter C.

  13. Find the drive letter you want changed. Look for “\DosDevices\D:”.
  14. Right-click \DosDevices\D:, and then click Rename.
  15. Rename it to the appropriate (new) drive letter “\DosDevices\C:”.
  16. Click the value for \DosDevices\Z:, click Rename, and then name it back to “\DosDevices\D:”.
  17. Quit Regedit, and then start Regedt32.
  18. Change the permissions back to the previous setting for Administrators (this should probably be Read Only).
  19. Restart the computer.
Applies to:
  • Microsoft Windows XP Home Edition
  • Microsoft Windows XP Professional
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows Server 2003, Enterprise x64 Edition
  • Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
  • Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
  • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
  • Microsoft Windows Server 2003, Web Edition