Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Jul 11, 2013

How to abort shutdown scheduled in windows

You may know that we can schedule a shutdown or hibernate after some time by

shutdown /s /t 3600

In case if you want to cancel it,  you can do that by below command,

shutdown /a


For your reference, the complete help details of shutdown command listed below,


C:\Users\mohan>shutdown /?
Usage: shutdown [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]
    [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]

    No args    Display help. This is the same as typing /?.
    /?         Display help. This is the same as not typing any options.
    /i         Display the graphical user interface (GUI).
               This must be the first option.
    /l         Log off. This cannot be used with /m or /d options.
    /s         Shutdown the computer.
    /r         Shutdown and restart the computer.
    /g         Shutdown and restart the computer. After the system is
               rebooted, restart any registered applications.
    /a         Abort a system shutdown.
               This can only be used during the time-out period.
    /p         Turn off the local computer with no time-out or warning.
               Can be used with /d and /f options.
    /h         Hibernate the local computer.
               Can be used with the /f option.
    /e         Document the reason for an unexpected shutdown of a computer.
    /m \\computer Specify the target computer.
    /t xxx     Set the time-out period before shutdown to xxx seconds.
               The valid range is 0-315360000 (10 years), with a default of 30.
               If the timeout period is greater than 0, the /f parameter is
               implied.
    /c "comment" Comment on the reason for the restart or shutdown.
               Maximum of 512 characters allowed.
    /f         Force running applications to close without forewarning users.
               The /f parameter is implied when a value greater than 0 is
               specified for the /t parameter.
    /d [p|u:]xx:yy  Provide the reason for the restart or shutdown.
               p indicates that the restart or shutdown is planned.
               u indicates that the reason is user defined.
               If neither p nor u is specified the restart or shutdown is
               unplanned.
               xx is the major reason number (positive integer less than 256).
               yy is the minor reason number (positive integer less than 65536).

Reasons on this computer:
(E = Expected U = Unexpected P = planned, C = customer defined)
Type    Major   Minor   Title

 U      0       0       Other (Unplanned)
E       0       0       Other (Unplanned)
E P     0       0       Other (Planned)
 U      0       5       Other Failure: System Unresponsive
E       1       1       Hardware: Maintenance (Unplanned)
E P     1       1       Hardware: Maintenance (Planned)
E       1       2       Hardware: Installation (Unplanned)
E P     1       2       Hardware: Installation (Planned)
E       2       2       Operating System: Recovery (Planned)
E P     2       2       Operating System: Recovery (Planned)
  P     2       3       Operating System: Upgrade (Planned)
E       2       4       Operating System: Reconfiguration (Unplanned)
E P     2       4       Operating System: Reconfiguration (Planned)
  P     2       16      Operating System: Service pack (Planned)
        2       17      Operating System: Hot fix (Unplanned)
  P     2       17      Operating System: Hot fix (Planned)
        2       18      Operating System: Security fix (Unplanned)
  P     2       18      Operating System: Security fix (Planned)
E       4       1       Application: Maintenance (Unplanned)
E P     4       1       Application: Maintenance (Planned)
E P     4       2       Application: Installation (Planned)
E       4       5       Application: Unresponsive
E       4       6       Application: Unstable
 U      5       15      System Failure: Stop error
 U      5       19      Security issue
E       5       19      Security issue
E P     5       19      Security issue
E       5       20      Loss of network connectivity (Unplanned)
 U      6       11      Power Failure: Cord Unplugged
 U      6       12      Power Failure: Environment
  P     7       0       Legacy API shutdown

Feb 26, 2013

How to find a system 32 or 64 bit

In any Linux variants either one of this should work ( Redhat, Cent-Os, Ubuntu, Hp-ux, Solaris etc )

[mohan@chinna ~]$ arch
x86_64
[mohan@chinna ~]$ uname -m
x86_64
[mohan@chinna ~]$ getconf LONG_BIT
64


As you can guess, 64 / x86_64 is 64bit system, whereas 32 / i386 / i686  denotes its a 32 bit sytem.


For windows
Right-click MyComputer->Properties

It will bring a window like below image, from that you can check the system type

Feb 19, 2013

File checksum utility for windows Xp

File checksum utility for windows Xp






Refer -  http://support.microsoft.com/kb/841290

Feb 17, 2013

How to count occurrences of a number or text in Excel

To count occurances of a particular number or words in a range of excel cells use formula

=COUNTIF(range,"pattern")
where range is the excel cells range where you want to search for the pattern. pattern can be numbers or words but it should be within double quotes "".

Example - To count number of occurance of word "present" in cells between A1 to A10. frame the formula like below

ex - COUNTIF(A1:A10,"Present")

also you can wildcard characters in the pattern.
Example   =COUNTIF(A1:A9,"*sent")

Feb 16, 2013

How to find filetype in windows


There is a utility called "file" in unix which determines filetype  of a file. There is no default similar utility available in windows.  After trying few utilities available online, I found this one more helpful.

http://home.fnal.gov/~jklemenc/dl/filetype.zip

Find more description about the tool at http://home.fnal.gov/~jklemenc/filetype.html

I have posted screenshot of an example

C:\Documents and Settings\tig\Desktop>filetype.exe
FileType.exe
  by: Joe Klemencic
  Copyright 2004

Usage:
   FILETYPE.EXE -i [-r] [-o ] [-v] [-?]

                -i - Inspect a single file or all files in a directory
                -r  - Rename the file with the correct extension (-o ignored)
                -o  - Output path for file copies (creates if not exist)
                -v  - Verbose output
                -?  - This help text


C:\Documents and Settings\tig\Desktop>filetype.exe -i  "Reach Out-participants.pdf"
Reach Out-participants.pdf (.pdf) "Adobe PDF File"

C:\Documents and Settings\tig\Desktop>filetype.exe -i  "Perl One Liners.htm"
Perl One Liners.htm (.txt) "Text file"

C:\Documents and Settings\tig\Desktop>filetype.exe -i  SyncToySetupPackage_v21_x86.exe
SyncToySetupPackage_v21_x86.exe (.exe) "Executable File"

C:\Documents and Settings\tig\Desktop>filetype.exe -i  toolsmanual.dvi
Could not identify toolsmanual.dvi, skipping....

C:\Documents and Settings\tig\Desktop>filetype.exe -i  quickCooking.do
quickCooking.do (.pdf) "Adobe PDF File"

Feb 14, 2013

Maximum length for naming a file in windows


In the Windows explorer the maximum length for naming a file is 260 characters including the drive letter and folders name.
Because windows has a predefined variable called MAX_PATH and its value is set to 260.


So when you try to create or copy a file it will return below error

cp: cannot create regular file    File name too long

sample filename :
C:\hudson\workspace\dev-project-eventsourcelibrary\project\initial\eventsourcelibrary\tmp\normaliser\etc\devices\nsm\reports\Network\Configuration and Policy Management\viewScreen-Security Management\NetScreen-Security Manager - Authentication and Login Events.xml 

So to avoid either you can reduce the characters by trimming the directories name length or use the "\\?\" prefix so that it will allow upto 32,767 characters.

To know more about this, refer microsoft's naming guide.
url-
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx#maxpath
----------------

Feb 13, 2013

How to perform shutdown from command prompt or to schedule shutdown/reboot/logoff in windows

There is a executable which comes default with windows namely, shutdown.exe which can be called in command prompt to shutdown the system.

To perform shutdown immediatly
c:\>shutdown /s /t 00

In this /s if for shutdown, similarly you can use /r for reboot /l for logoff etc.


To shutdown windows in 1 hour
c:\>shutdown /s /t 3600

refer manual for additional options

c:\>shutdown /?

Jul 27, 2012

How to add 'open Command Prompt Here' open in windows 7 while right clicking a directory ?

In windows, under xp and few other flavours we have to add certain values in registry to get the option of opening command prompt from a particular directory.

But windows 7 has this feature by default, but you have to hold 'shift' and do a right click.

Default behaviour when doing a right click on a directory
 when you hold shift and right click on a folder ,you will see the option "Open command prompt here"






Oct 10, 2011

How to Find Uptime in windows


In Windows to find how long the system is ON or UP after starting, you can execute  the command 'net stats srv' in command prompt.
There is another one utility called 'uptime.exe' for the same purpose but you have download them explicitly.


Mar 24, 2011

The following boot-start or system-start driver(s) failed to load: black

Problem
System hangs with leaving below description in Event Viewer.
"The following boot-start or system-start driver(s) failed to load:  black"

Solution 

Could not understand the rootcause of the problem.  But we can stop this by setting  below registry key value to 4


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Black

Choose the Start DWORD and set the value to 4










Mar 10, 2011

How to find filetype in windows

There is a utility called "file" in unix which determines filetype  of a file. There is no default similar utility available in windows.  After trying few utilities available online, I found this one more helpful.

http://home.fnal.gov/~jklemenc/dl/filetype.zip

Find more description about the tool at http://home.fnal.gov/~jklemenc/filetype.html

I have posted screenshot of an example


C:\Documents and Settings\tig\Desktop>filetype.exe
FileType.exe
  by: Joe Klemencic
  Copyright 2004
 Usage:
   FILETYPE.EXE -i [-r] [-o ] [-v] [-?]
                 -i - Inspect a single file or all files in a directory
                -r  - Rename the file with the correct extension (-o ignored)
                -o  - Output path for file copies (creates if not exist)
                -v  - Verbose output
                -?  - This help text
  C:\Documents and Settings\tig\Desktop>filetype.exe -i  "Reach Out-participants.pdf"
Reach Out-participants.pdf (.pdf) "Adobe PDF File"
 C:\Documents and Settings\tig\Desktop>filetype.exe -i  "Perl One Liners.htm"
Perl One Liners.htm (.txt) "Text file"
 C:\Documents and Settings\tig\Desktop>filetype.exe -i  SyncToySetupPackage_v21_x86.exe
SyncToySetupPackage_v21_x86.exe (.exe) "Executable File"
 C:\Documents and Settings\tig\Desktop>filetype.exe -i  toolsmanual.dvi
Could not identify toolsmanual.dvi, skipping....
 C:\Documents and Settings\tig\Desktop>filetype.exe -i  quickCooking.do
quickCooking.do (.pdf) "Adobe PDF File"








Feb 16, 2011

How to check windows installer version in windows

To know the version of windows installer available in your windows, check the version of msi.dll present in c:\WINNT\system32

select   msi.dll -> rightclick -> Properties -> choose "Version" tab

It will have information like

File version : 3.1.4000.4039  

Aug 17, 2010

Problem Ejecting USB Mass Storage Device

Problem:

Could not unmount USB device.  Receiving error message

---------------------------
Problem Ejecting USB Mass Storage Device
---------------------------
The device 'Generic volume' cannot be stopped right now.  Try stopping the device again later.
---------------------------
OK  
---------------------------


Solution:

Download tool called "unlocker" and choose the drive which you want to unmount.

http://download.cnet.com/Unlocker/3000-2248_4-10493998.html

Nov 11, 2009

How to enable character auto completion in windows

1)open REGEDIT (Start/Run)
2)Locate and open the following:
HKEY_CURRENT_USER/ Software/Microsoft/CommandProcessor

3)Double click on the "CompletionChar" key .
4)Change the value of the key to: 9
5)Close command prompt and open a new command prompt to see the auto character completion feature enabled.

Could not hibernate system or hibernate failing

Problem:
Could not hibernate system or hibernate failing

Error Message:
Windows - System Error
Insufficient system resources exist to complete the API

Solution :
This problem typically occurs when the computer uses 1 gigabyte (GB) or more of RAM.  Try hibernating after closing  unneccessary programs and reducing the RAM usage.
    (or)
This problem occurs because the Windows kernel power manager cannot obtain the memory resources that are required to prepare the computer to hibernate.
Refer
http://support.microsoft.com/kb/909095

Error 1311.Source file not found:

Error Message:
Error 1311.Source file not found: \\thiagu-lxp\vsvstdd2 (d)\_15777_RTL_x86_enu_VSD_Common.cab.  Verify that the file exists and that you can access it.

Fix:
This error comes when we try to install Visual Studio from remote workstation's CD drive. Just replace Disc1 with Disc2 and give 'retry' installation will go on until another similar error message. then insert Disc3 and give 'retry'

How to print list of installed softwares in Windows ?

write a windows .bat script with following commands and run it. You can find the file named 'software_list.txt' will be created with list of installed softwares in it.


echo List of softwares > software_list.txt
echo ================= >>software_list.txt
reg export HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall temp1.txt
find "DisplayName" temp1.txt| find /V "ParentDisplayName" > temp2.txt
for /f "tokens=2,3 delims==" %%a in (temp2.txt) do (echo %%a >> software_list.txt)
del temp1.txt temp2.txt

The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft'

Problem:
The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)   
C:\mohant\Perforce\dev\solutions\sharepoint\SecureSharePoint\SPObjectHelper.cs    7    17    RSASecureSharePointLibrary

Solution:
The reference it is looking for is missing. Make sure the program is installed or if it is available add the reference.
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\Microsoft.SharePoint.dll