Monday, April 22, 2013

MS windows commands


1. How to check services status.? sc query "servicename"

Example:

C:\Users\ sc  query  appraisal
SERVICE_NAME: appraisal
        TYPE               : 20  WIN32_SHARE_PROCESS
        STATE              : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0
-------------------------------------------------------------------------------
2. How to check appliction/service  PID

C:\Users > sc queryex appraisal

SERVICE_NAME: appraisal

        TYPE               : 20  WIN32_SHARE_PROCESS
        STATE              : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0
        PID                : 892
       

--------------------------------------------------------------------------------

How to reset your Windows Server 2008 / 2008R2 Administrator password
 using the Windows Server DVD? If the server is production box, Configured with RAID.

Note:  Raid disks and RAID card that is not detected by Windows Server 2008

Don't Panic..

Steps  below...

1. We need Windows Server 2008 DVD ready in the drive.
2. If your system uses a HP/IBM RAID card that is not detected by Windows Server 2008, have those drivers handy (the .inf file along with the other files - not .zip or .exe files!) on a USB flash drive or Using HP/IBM vendor CD.
3. Reboot the server from the Windows Server installation DVD
4. After selecting language etc, on the next screen where you would select "Install", look a bit further down. There is an option for "Repair". Select that.
5. On the next screen, you should see you O/S in the list. If not, you will need to load the RAID drivers. Select "Load Drivers", insert the USB flash disk or HP/IBM vendor CD then select your drivers. Once installed, you will see your Windows Server installation in the list. Select that one and click Next. Note the drive letter!!!
6. On the next screen, select "Command Prompt"

The Command prompt will now open.

7. Change to the drive letter of your Windows Server installation as noted above (c:, enter)

8. Change to C:\windows\system32 (cd c:\windows\system32, enter )

e.g C:\windows\system32 -

C:\windows\system32 - This folder has more exe file related system.

It has utilman.exe and cmd.exe.

9. Move Utilman.exe to Utilman.exe.bak (move Utilman.exe Utilman.exe.bak, enter)

C:\windows\system32 > move utilman.exe utilman.exe.bak

10. Copy cmd.exe over Utilman.exe (copy cmd.exe Utilman.exe, enter)

C:\windows\system32> copy cme.ex utilman.exe

11. Exit, then reboot your server normally


With your server restarted and at the login screen


a. Press CMD+U together. You will now see the command prompt

b. Reset the desired user password (net user username newpassword)

e.g : net user user_name  new_password
       net user administrator  new_password

c. Once reset, exit Command Prompt and log in with the new credentials

Cool..