Showing posts with label Commands. Show all posts
Showing posts with label Commands. Show all posts

Recycle Bin Empty from Command

You can effectively "empty" the Recycle Bin from the command line by permanently deleting the Recycle Bin directory on the drive that contains the system files. (In most cases, this will be the C: drive, but you shouldn't hardcode that value because it won't always be true. Instead, use the %systemdrive% environment variable.)

The reason that this tactic works is because each drive has a hidden, protected folder with the name $Recycle.bin, which is where the Recycle Bin actually stores the deleted files and folders. When this directory is deleted, Windows automatically creates a new directory.

So, to remove the directory, use the rd command (r​emove d​irectory) with the /s parameter, which indicates that all of the files and directories within the specified directory should be removed as well:

  • For Windows 7 or Server 2008 enter this command:

rd /s /q "%systemdrive%\$Recycle.Bin"

  • For Windows XP, Vista, or Server 2003 enter this command:

rd /s /q "%systemdrive%\recycler"

Do note that this action will permanently delete all files and folders currently in the Recycle Bin from all user accounts. Additionally, you will (obviously) have to run the command from an elevated command prompt in order to have sufficient privileges to perform this action.

Site


Delete User Profile

1:55 PM by Yash Kalra 0 comments

We can delete the old profiles lying in the system c:\documents and settings\ you can use the below command
delprof /Q /I /D:60

this will delete the profiles not in use more than 60 days


From Command Line Block ports

1:52 PM by Yash Kalra 0 comments

For Windows Vista & Windows 7 above

This is easy using the 'netsh' command.

To block it we would call it like this:

netsh advfirewall firewall add rule name="BlockAIM" protocol=TCP
dir=out remoteport=4099 action=block

Let me explain each setting:

name = The name of the rule. (Pick something descriptive)
protocol = The protocol we are going to block (UDP or TCP for most cases)
dir = The direction of the block. Can be IN or OUT
remoteport = The port of the remote host that is going to be blocked
action = Could be block or allow. In our case we want to block the connection

Once you execute the above code, all outbound requests to any host on port 4099 will be blocked, and it adds an entry to the Windows firewall.

If you want to remove the rule from the command line, you can call netsh like this:

netsh advfirewall firewall delete rule name="BlockAIM"

That is all there is to it. One line to add a rule, and one line to remove.


Networking Commands

TRACERT COMMANDS IS A WINDOWS UTLITY WHICH HELPS TO TRACE THE ROUTE OF PACKETS ON A NETWORK.
ITS ONE OF A USEFULL TOOL USED IN FINDING THE IP ADRESS OF A PERSON OR SERVER.
WHEN WE ARE CONNECTED TO A COMPUTER. AS EACH PACKETS OF TINFORMATION TO OUR COMPUTER PASSES TO THE NET
THROUGH ROUTERS .THE TRACING OF PACKETS HELPS US WITH. FINDING THE DESTINATION.
TRACE NETWORK : tracert [-d][-h maximum_hops][-j host-list][-w
timeout]target_name
PACKET/SITE TO IP
-d : do not resolve addresses to hostnames
-h maximum_hops : maximum number of hops to search for target
-j host-list : loose source route along host-list
-w timeout : wait timeout milliseconds for each reply
EX : TRACERT 192.63.19.100
--------------------------------------------------------------------------------------------
THIS UTLITY WAS USED TO KNOW WHETHER A SYSTEM OR SERVER IS ALIVE OR NOT WE SEND IT WITH A FEW PACKETS OF DATA .AND IF WE DOSENT HAS ANY LOSS OF DATA WHILE THE TRAFIC THE SERVE IS ALIVE.
PING HOST/IP : ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]][-w timeout] destination-list

Options:
-t Pings the specified host until stopped.
To see statistics and continue - type Control-Break;
To stop - type Control-C.
-a Resolve addresses to hostnames.
-n count Number of echo requests to send.
-l size Send buffer size.
-f Set Don't Fragment flag in packet.
-i TTL Time To Live.
-v TOS Type Of Service.
-r count Record route for count hops.
-s count Timestamp for count hops.
-j host-list Loose source route along host-list.
-k host-list Strict source route along host-list.
-w timeout Timeout in milliseconds to wait for each reply.
EX:PING 192.62.99.100
--------------------------------------------------------------------------------------------
THIS WILL BE FAIRLY IMPORTANT WHILE WE NEED TO DISGUISE AS SOME BODY AS AN IP ADRESS IS ONE KIND OF AUTHENTICATION CHANGE IP ON A
NETWORK CARD : ARP -s inet_addr eth_adr [if_addr]
ARP -d inet_addr [if_addr]
ARP -a [inet_addr] [-N if_addr]

-a :Displays current ARP entries by interrogating the current protocol data.
If inet_addr is specified, the IP and Physical addresses for only the specified computer are displayed. If more than one network interface uses ARP, entries for each ARP table are displayed.
-g : Same as -a
inet_addr : Specifies an internet address.
-N if addr : Displays the ARP entries for the network interface specified
by if_addr.
-d : Deletes the host specified by inet_addr.
-s : Adds the host and associates the Internet address inet_addr with the
Physical address eth_addr. The Physical address is given as 6 hexadecimal bytes seperated by hyphens. The entry is permanent.
eth_addr : Specifies a physical address
if_addr : If present, this specifies the Internet address of the interface
whose address translation table should be modified. If not present, the first applicable interface will be used.
--------------------------------------------------------------------------------------------

DISPLAY OR CHANGE FILE ATTRIBUTES : ATTRIB [+R|-R] [+A|-A] [+S|-S] [+H|-H]
[[drive:][path]filename] [/S]

+ Sets an attribute.
- Clears an attribute.
R Read-only file attribute.
A Archive file attribute.
S System file attribute.
H Hidden file attribute.
/S Processes files in all directories in the specified path.
--------------------------------------------------------------------------------------------
VIEW A NETWORK Using NET.exe
/NETWORK SETTINGS : NET CONFIG Displays your current workgroup settings.
NET CONFIG [/YES]

/YES Carries out the NET CONFIG command without first prompting you to provide information or confirm actions.

NET DIAG Runs the Microsoft Network Diagnostics program to test the hardware
connection between two computers and to display information about a single computer.

NET DIAGNOSTICS [/NAMES | /STATUS]
/NAMES Specifies a diagnostic server name in order to avoid conflicts when
NET DIAG is used simultaneously by multiple
users. This option works only when the network uses a NetBIOS protocol.
/STATUS Enables you to specify a computer about which you want network
diagnostics information.


NET HELP Displays information about NET commands and error messages.
command /?
NET HELP [suffix]
NET HELP errornum

command /? -Specifies the Microsoft NET command that you want information
about.
suffix -Specifies the second word of the command you want information
about. For example, the suffix of NET VIEW is VIEW.
errornum -Specifies the number of the error message that you want
information about.


NET INIT Loads protocol and network-adapter drivers without binding them to
Protocol Manager. This command may be required if you are using a third-party network-adapter driver. You can then bind the drivers to Protocol Manager by typing
NET START NETBIND.
NET INITIALIZE [/DYNAMIC]


/DYNAMIC Loads the Protocol Manager dynamically. This is useful with some
third-party networks, such as Banyan® VINES®, to resolve memory problems.


NET LOGOFF Breaks the connection between your computer and the shared
resources to which it is connected.
NET LOGOFF [/YES]

/YES Carries out the NET LOGOFF command without first prompting you to
provide information or confirm actions.


NET LOGON Identifies you as a member of a workgroup.
NET LOGON [user [password | ?]] [/DOMAIN:name] [/YES] [/SAVEPW:NO]


user- Specifies the name that identifies you in your workgroup. The name you
specify can contain up to 20 characters.
password -The unique string of characters that authorizes you to gain access
to your password-list file. The password
can contain up to 14 characters.
? -Specifies that you want to be prompted for your password.
/DOMAIN -Specifies that you want to log on to a Microsoft Windows NT or LAN
Manager domain. name Specifies the Windows NT
or LAN Manager domain you want to log on to.
/YES -Carries out the NET LOGON command without first prompting you to
provide information or confirm actions.
/SAVEPW:NO Carries out the NET LOGON command without prompting you to
create a password-list file.

If you would rather be prompted to type your user name and password instead
of specifying them in the NET LOGON command
line, type NET LOGON without options.


NET PASSWORD Changes your logon password.
NET PASSWORD [oldpassword [newpassword]]
NET PASSWORD
\\computer| /DOMAIN:name [user [oldpassword [newpassword]]]

oldpassword -Specifies your current password.
newpassword -Specifies your new password. It can have as many as 14
characters.
computer -Specifies the Windows NT or LAN Manager server on which you want
to change your password.
/DOMAIN -Specifies that you want to change your password on a Windows NT or LAN Manager domain.
name -Specifies the Windows NT or LAN Manager domain on which you want to change your password.
user -Specifies your Windows NT or LAN Manager user name.

The first syntax line above is for changing the password for your password-list file. The second syntax line above is for changing your password on a Windows NT or LAN Manager server or domain.

NET PRINT Displays information about print queues and controls print jobs.
NET PRINT
\\computer[\printer] | port [/YES]
NET PRINT
\\computer| port [job# [/PAUSE | /RESUME | /DELETE]] [/YES]

computer -Specifies the name of the computer whose print queue you want
information about.
printer -Specifies the name of the printer you want information about.
port -Specifies the name of the parallel (LPT) port on your computer that is
connected to the printer you want information about.
job# -Specifies the number assigned to a queued print job. You can specify
the following options:
/PAUSE -Pauses a print job.
/RESUME -Restarts a print job that has been paused.
/DELETE -Cancels a print job.
/YES -Carries out the NET PRINT command without first prompting you to
provide information or confirm actions.

When you specify the name of a computer by using the NET PRINT command, you
receive information about the print queues
on each of the shared printers that are connected to the computer.


NET START Starts services. NOTE: Services cannot be started from a command
prompt within Windows.
NET START [BASIC | NWREDIR | WORKSTATION | NETBIND | NETBEUI | NWLINK]
[/LIST] [/YES] [/VERBOSE]


BASIC Starts the basic redirector.
NWREDIR Starts the Microsoft Novell® compatible redirector.
WORKSTATION Starts the default redirector.
NETBIND Binds protocols and network-adapter drivers.
NETBEUI Starts the NetBIOS interface.
NWLINK Starts the IPX/SPX-compatible interface.
/LIST Displays a list of the services that are running.
/YES Carries out the NET START command without first prompting you to
provide information or confirm actions.
/VERBOSE Displays information about device drivers and services as they are
loaded.

To start the workgroup redirector you selected during Setup, type NET START
without options. In general, you don't need to use any of the options.


NET STOP Stops services. NOTE: Services cannot be stopped from a command
prompt within Windows.

NET STOP [BASIC | NWREDIR | WORKSTATION | NETBEUI | NWLINK] [/YES]
NET STOP Stops the basic redirector.
BASIC Stops the basic redirector.
NWREDIR Stops the Microsoft Novell® compatible redirector.
WORKSTATION Stops the default redirector.
NETBEUI Stops the NetBIOS interface.
NWLINK Stops the IPX/SPX compatible interface.
/YES Carries out the NET STOP command without first prompting you to provide
information or confirm actions.

To stop the workgroup redirector, type NET STOP without options. This breaks
all your connections to shared resources and removes the NET commands from your computer's memory.


NET TIME Displays the time on or synchronizes your computer's clock with the
shared clock on a Microsoft Windows for Workgroups,Windows NT, Windows 95, or NetWare time server.
NET TIME [\\computer | /WORKGROUP:wgname] [/SET] [/YES]


computer -Specifies the name of the computer (time server) whose time you
want to check or synchronize your computer's
clock with. /WORKGROUP Specifies that you want to use the clock on a computer (time
server) in another workgroup.
wgname -Specifies the name of the workgroup containing a computer whose
clock you want to check or synchronize your computer's clock with.
If there are multiple time servers in that workgroup, NET TIME uses the
first one it finds.
/SET Synchronizes your computer's clock with the clock on the computer or
workgroup you specify.
/YES Carries out the NET TIME command without first prompting you to provide
information or confirm actions.


NET USE Connects or disconnects your computer from a shared resource or
displays information about your connections.
NET USE [drive: | *] [\\computer\directory [password | ?]]
[/SAVEPW:NO] [/YES] [/NO]
NET USE [port:] [\\computer\printer [password | ?]]
[/SAVEPW:NO] [/YES] [/NO]

NET USE drive: | \\computer\directory/DELETE [/YES]
NET USE port: |
\\computer\printer/DELETE [/YES]
NET USE * /DELETE [/YES]

NET USE drive: | * /HOME

drive -Specifies the drive letter you assign to a shared directory.
* -Specifies the next available drive letter. If used with /DELETE,
specifies to disconnect all of your connections.
port -Specifies the parallel (LPT) port name you assign to a shared printer.
computer -Specifies the name of the computer sharing the resource.
directory -Specifies the name of the shared directory.
printer -Specifies the name of the shared printer.
password -Specifies the password for the shared resource, if any.
? -Specifies that you want to be prompted for the password of the shared
resource. You don't need to use this option unless the password is optional.
/SAVEPW:NO Specifies that the password you type should not be saved in your
password-list file. You need to retype the password the next time you connect to this resource.
/YES Carries out the NET USE command without first prompting you to provide
information or confirm actions.
/DELETE Breaks the specified connection to a shared resource.
/NO Carries out the NET USE command, responding with NO automatically when
you are prompted to confirm actions.
/HOME Makes a connection to your HOME directory if one is specified in your
LAN Manager or Windows NT user account.

To list all of your connections, type NET USE without options.

NET VER Displays the type and version number of the workgroup redirector you
are using.
NET VER


NET VIEW Displays a list of computers in a specified workgroup or
the shared resources available on a specified computer.
NET VIEW [\\computer] [/YES]
NET VIEW [/WORKGROUP:wgname] [/YES]


computer -Specifies the name of the computer whose shared resources you want
to see listed.
/WORKGROUP Specifies that you want to view the names of the computers in
another workgroup that share resources.
wgname -Specifies the name of the workgroup whose computer names you want to
view.
/YES Carries out the NET VIEW command without first prompting you to provide
information or confirm actions.

To display a list of computers in your workgroup that share
resources, type NET VIEW without options.
--------------------------------------------------------------------------------------------

DEBUG : DEBUG [[drive:][path]filename [testfile-parameters]]
[drive:][path]filename Specifies the file you want to test.
testfile-parameters Specifies command-line information required by the
file you want to test.

***After Debug starts, type ? to display a list of debugging commands.***
To get out of Debug you need to "Q" and enter
To execute the Debug routine you need to do "G" and enter

--------------------------------------------------------------------------------------------
IPCONFIG : ipconfig [/all][/batch][/renew_all][/release_all][/renew
N][/release N]

/All Display detailed information.
/Batch [file] Write to file or ./WINIPCFG.OUT
/renew_all Renew all adapters.
/release_all Release all adapters.
/renew N Renew adapter N.
/release N Release adapter N.
--------------------------------------------------------------------------------------------
FTP : Depending upon the version of FTP and the Operating System being
used each of the following commands may or may
not work. Generally typing -help or a ? will list the commands
available to you.
Command Information
! : Using this command you will have the capability of toggling back and
forth between the operating system and ftp.
Once back in the Operating System generally typing exit will take you
back to the FTP command line.
? : Access the Help screen.
abor : Abort Transfer
append : Append text to a local file.
ascii : Switch to ASCII transfer mode
bell : Turns bell mode on / off.
binary : Switches to binary transfer mode.
bye : Exits from FTP.
cd : Changes directory.
cdup : Change to parent directory on remote system
close : Exits from FTP.
cwd : Change working directory on remote system
dele : Delete file on remote system
delete : Deletes a file.
debug : Sets debugging on / off.
dir : Lists files if connected.
dir -C = Will list the files in wide format.
dir -1 = Lists the files in bare format in alphabetic order
dir -r = Lists directory in reverse alphabetic order.
dir -R = Lists all files in current directory and sub directories.
dir -S = Lists files in bare format in alphabetic order.
disconnect : Exits from FTP.
get : Get file from the computer connected to.
glob : Sets globbing on / off.
hash : Sets hash mark printing on / off
help : Access the Help screen and displays information about command if
command typed after help.
lcd : Displays local directory or if path typed after lcd will change local
directory.
list : Send a list of file names in the current directory on the remote
system on the data connection.
literal : Sends command line
ls : Lists files if connected.
mdelete : Multiple delete
mdir : Lists contents of multiple remote directories
mget : Get multiple files
mkd : Make directory.
mkdir : Make directory.
mls : Lists contents of multiple remote directories.
mode : Specifies the transfer mode. Available parameters are generally S, B
or C.
mput : Sent multiple files
nlst : Send a full directory listing of the current directory on the remote
system on the data connection.
open : Opens address.
pass : Supplies a user password.
port : Specify the client port number.
prompt : Enables disables prompt.
put : Send one file
pwd : Print working directory
quit : Exits from FTP.
quote : Send arbitrary ftp command
recv : Receive file
retr : Get file from remote system.
remotehelp : Get help from remote server
rename : Renames a file
rmdir : Removes a directory
send : Send single file
status : Shows status of currently enabled / disabled options
trace : Toggles packet tracing
type : Set file transfer type
user : Send new user information
verbose : Sets verbose on / off.
--------------------------------------------------------------------------------------------
DISPLAY TCP/IP
NETWORK PROTOCOL : NETSTAT [-a] [-e] [-n] [-s] [-p proto] [-r] [interval]
INFORMATION
-a Displays all connections and listening ports.
-e Displays Ethernet statistics. This may be combined with the -s option.
-n Displays addresses and port numbers in numerical form.
-p proto -Shows connections for the protocol specified by proto; proto may
be TCP or UDP. If used with the -s option
to display per-protocol statistics, proto may be TCP, UDP, or IP.
-r Displays the routing table.
-s Displays per-protocol statistics. By default, statistics are shown for
TCP, UDP and IP; the -p option may be used to specify a subset of the default.
interval Redisplays selected statistics, pausing interval seconds between
each display. Press CTRL+C to stop redisplaying statistics. If omitted, netstat will print the current
configuration information once.
--------------------------------------------------------------------------------------------
DISPLAY OR SET A SEARCH PATH FOR EXECUTABLE FILES :
PATH [[drive:]path[;...]]
PATH ;
Type PATH ; to clear all search-path settings and direct Windows to search
only in the current directory.
Type PATH without parameters to display the current path.
--------------------------------------------------------------------------------------------
MANUALLY CONFIGURE MODEMS ROUTE :
ROUTE [-f] [-p] [command [destination] [MASK netmask] [gateway] [METRIC
metric]
[IF interface]
-f Clears the routing tables of all gateway entries. If this is used in
conjunction with one of the commands, the tables are cleared prior to running the command.
-p When used with the ADD command, makes a route persistent across boots of
the system. By default, routes are not
preserved when the system is restarted. When used with the PRINT
command, displays the list of registered persistent routes. Ignored for all other commands, which always affect the appropriate persistent routes. This option
is not supported Windows'95. command One of these:
PRINT Prints a route
ADD Adds a route
DELETE Deletes a route
CHANGE Modifies an existing route destination Specifies the host.
MASK Specifies that the next parameter is the 'netmask' value.
NETMASK Specifies a subnet mask value for this route entry. If not
specified, it defaults to 255.255.255.255.
GATEWAY Specifies gateway. interface the interface number for the specified
route.
METRIC Specifies the metric, ie. cost for the destination.
All symbolic names used for destination are looked up in the network
database file NETWORKS. The symbolic names for
gateway are looked up in the host name database file HOSTS.
If the command is PRINT or DELETE. Destination or gateway can be a wildcard,
(wildcard is specified as a star '*'), or the gateway argument may be omitted.
If Dest contains a * or ?, it is treated as a shell pattern, and only
matching destination routes are printed. The '*' matches any string,
and '?' matches any one char. Examples: 157.*.1, 157.*, 127.*, *224*.
Diagnostic Notes: Invalid MASK generates an error, that is when (DEST & MASK) != DEST.
Example> route ADD 157.0.0.0 MASK 155.0.0.0 157.55.80.1 IF 1
The route addition failed: 87

EXAMPLES
Examples:
>route PRINT
>route ADD 157.0.0.0
^destination
MASK 255.0.0.0
^mask 157.55.80.1
^gateway METRIC 3
^metric IF 2
^Interface
If IF is not given, it tries to find the best interface for a given gateway.
>route PRINT
>route PRINT 157* .... Only prints those matching 157*
>route DELETE 157.0.0.0
>route PRINT
One way to use this would be as follows: You can't ping the server that you
are connecting to, but you know the ip address to be 127.16.16.10
>route PRINT
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 14 a4 c3 44 20 ...... Xircom CardBus Ethernet 10/100 Adapter
0x3 ...00 b0 d0 43 55 a5 ...... 3Com EtherLink PCI
0x4 ...00 01 b0 8f 8f 80 ...... NdisWan Adapter
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 127.16.8.14 127.16.8.14 1
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
127.16.0.0 255.255.0.0 127.16.8.14 127.16.8.14 1
127.16.8.14 255.255.255.255 127.0.0.1 127.0.0.1 1
192.168.50.0 255.255.255.0 192.168.50.65 192.168.50.65 2
192.168.50.65 255.255.255.255 127.0.0.1 127.0.0.1 1
192.168.50.255 255.255.255.255 192.168.50.65 192.168.50.65 1
224.0.0.0 224.0.0.0 127.16.8.14 127.16.8.14 1
224.0.0.0 224.0.0.0 192.168.50.65 192.168.50.65 1
255.255.255.255 255.255.255.255 192.168.50.65 192.168.50.65 1
** notice that no gateway for the current ip goes to 255.255.255.0, so it
must be added. Now do the following command:
>route ADD 127.16.0.0 MASK 255.255.255.0 <your current ip from winntcfg or
>winipcfg> METRIC 1
**Then do the following command:
>route print
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 127.16.8.14 127.16.8.14 1
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
127.16.0.0 255.255.0.0 127.16.8.14 127.16.8.14 1
** 127.16.0.0 255.255.255.0 127.16.8.14 127.16.8.14 1
127.16.8.14 255.255.255.255 127.0.0.1 127.0.0.1 1
192.168.50.0 255.255.255.0 192.168.50.65 192.168.50.65 2
192.168.50.65 255.255.255.255 127.0.0.1 127.0.0.1 1
192.168.50.255 255.255.255.255 192.168.50.65 192.168.50.65 1
224.0.0.0 224.0.0.0 127.16.8.14 127.16.8.14 1
224.0.0.0 224.0.0.0 192.168.50.65 192.168.50.65 1
255.255.255.255 255.255.255.255 192.168.50.65 192.168.50.65 1

**Notice the ** ip address gives you the default gateway.
--------------------------------------------------------------------------------------------
DISPLAY PROTOCOL STATISTICS
AND CURRENT TCP/IP CONNECTIONS
USING NBT(NETBIOS OVER TCP/IP): NBTSTAT [-a RemoteName] [-A IP address]
[-c] [-n]
[-r] [-R] [-s] [S] [interval] ]
-a (adapter status): Lists the remote machine's name table given its name
-A (Adapter status): Lists the remote machine's name table given its IP address
-c (cache) : Lists the remote name cache including the IP addresses
-n (names) : Lists local netBIOS names
-r (resolved) : Lists names resolved by broadcast and via WINS
-R (Reload) : Purges and reloads the remote cache name table
-S (Sessions) : Lists sessions table with the destination IP addresses
-s (sessions) : Lists sessions table converting destination IP addresses to host names via the hosts file RemoteName Remote host machine name. IP address Dotted decimal representation of the IP address. interval Redisplays selected statistics, pausing interval seconds between each display. Press Ctrl+C to stop redisplaying statistics.

Site


On Command Line- Find Out BIOS, Motherboard and CPU info

Info about your system's BIOS, then type this command

wmic bios get name,serialnumber,version

Info about your BIOS name, current version and it's serial number if there is any.

wmic csproduct get name,identifyingnumber,uuid

Info about your System motherboard (that happen to be the name) and it's UUID

wmic cpu get name,CurrentClockSpeed,MaxClockSpeed

Info about what's the CPU clock speed, also if you have turbo boost CPUs, what's the Max Clock Speed your system is capable of for the current configuration. Of course you can always overclock your CPU and that will too reflect the change.

wmic cpu get name,CurrentClockSpeed,MaxClockSpeed /every:1

If you have dynamic clock speed running, then add this line, it will refresh and monitor the Clock speed every 1 second.


Unlock Oracle- Scott ID

After installation of Oracle10g, there was a problem ..couldnt login using SQL+. None of the accounts(scott/tiger) worked . At last a quick web search gave the solution . Here is what it is:

From your command prompt, type

sqlplus "/ as sysdba"

Once logged in as SYSDBA, you need to unlock the SCOTT account
SQL> alter user scott account unlock;
SQL> grant connect, resource to scott;

Accessing the "em" web application ?
http://hostname:1158/em

http://database-host:1158/em

Login as:
username : sysdba
password : <password>
Connect : Sysdba

Source


Windows 7 Shortcut Keys - Final

Windows 7 Calculator keyboard shortcut keys

Alt + 1 Switch to Standard mode
Alt + 2 Switch to Scientific mode
Alt + 3 Switch to Programmer mode
Alt + 4 Switch to Statistics mode
Ctrl + E Open date calculations
Ctrl + H Turn calculation history on or off
Ctrl + U Open unit conversion
Alt + C Calculate or solve date calculations and worksheets
F1 Open Calculator Help
Ctrl + Q Press the M- button
Ctrl + P Press the M+ button
Ctrl + M Press the MS button
Ctrl + R Press the MR button
Ctrl + L Press the MC button
% Press the % button
F9 Press the +/- button
/ Press the / button
* Press the * button
+ Press the + button
- Press the - button
R Press the 1/× button
@ Press the square root button
0-9 Press the number buttons (0-9)
= Press the = button
. Press the . (decimal point) button
Backspace Press the backspace button
Esc Press the C button
Del Press the CE button
Ctrl + Shift + D Clear the calculation history
F2 Edit the calculation history
Up Arrow key Navigate up in the calculation history
Down Arrow key Navigate down in the calculation history
Esc Cancel editing the calculation history
Enter Recalculate the calculation history after editing
F3 Select Degrees in Scientific mode
F4 Select Radians in Scientific mode
F5 Select Grads in Scientific mode
I Press the Inv button in Scientific mode
D Press the Mod button in Scientific mode
Ctrl + S Press the sinh button in Scientific mode
Ctrl + O Press the cosh button in Scientific mode
Ctrl + T Press the tanh button in Scientific mode
( Press the ( button in Scientific mode
) Press the ) button in Scientific mode
N Press the ln button in Scientific mode
; Press the Int button in Scientific mode
S Press the sin button in Scientific mode
O Press the cos button in Scientific mode
T Press the tan button in Scientific mode
M Press the dms button in Scientific mode
P Press the pi button in Scientific mode
V Press the F-E button in Scientific mode
X Press the Exp button in Scientific mode
Q Press the x^2 button in Scientific mode
Y Press the x^y button in Scientific mode
# Press the x^3 button in Scientific mode
L Press the log button in Scientific mode
! Press the n! button in Scientific mode
Ctrl + Y Press the y?x button in Scientific mode
Ctrl + B Press the 3?x button in Scientific mode
Ctrl + G Press the 10x button in Scientific mode
F5 Select Hex in Programmer mode
F6 Select Dec in Programmer mode
F7 Select Oct in Programmer mode
F8 Select Bin in Programmer mode
F12 Select Qword in Programmer mode
F2 Select Dword in Programmer mode
F3 Select Word in Programmer mode
F4 Select Byte in Programmer mode
K Press the RoR button in Programmer mode
J Press the RoL button in Programmer mode
< Press the Lsh button in Programmer mode
> Press the Rsh button in Programmer mode
% Press the Mod button in Programmer mode
( Press the ( button in Programmer mode
) Press the ) button in Programmer mode
| Press the Or button in Programmer mode
^ Press the Xor button in Programmer mode
~ Press the Not button in Programmer mode
& Press the And button in Programmer mode
A-F Press the A-F buttons in Programmer mode
Spacebar Toggles the bit value in Programmer mode
A Press the Average button in Statistics mode
Ctrl + A Press the Average Sq button in Statistics mode
S Press the Sum button in Statistics mode
Ctrl + S Press the Sum Sq button in Statistics mode
T Press the S.D. button in Statistics mode
Ctrl + T Press the Inv S.D. button in Statistics mode
D Press the CAD button in Statistics mode

Windows 7 Dialog box keyboard shortcut keys

Ctrl + Tab Move forward through tabs
Ctrl + Shift + Tab Move back through tabs
Tab Move forward through options
Shift + Tab Move back through options
Alt + underlined letter Perform the command (or select the option) that goes with that letter
Enter Replaces clicking the mouse for many selected commands
Spacebar Select or clear the check box if the active option is a check box
Arrow keys Select a button if the active option is a group of option buttons
F1 Display Help
F4 Display the items in the active list
Backspace Open a folder one level up if a folder is selected in the Save As or Open dialog box

Windows 7 Ease of Access keyboard shortcut keys

Right Shift for eight seconds Turn Filter Keys on and off
Left Alt + Left Shift + PrtScn (or PrtScn) Turn High Contrast on or off
Left Alt + Left Shift + Num Lock Turn Mouse Keys on or off
Shift five times Turn Sticky Keys on or off
Num Lock for five seconds Turn Toggle Keys on or off
Windows logo key + U Open the Ease of Access Center

Windows 7 General keyboard shortcut keys

F1 Display Help
Ctrl + C (or Ctrl + Insert) Copy the selected item
Ctrl + X Cut the selected item
Ctrl + V (or Shift + Insert) Paste the selected item
Ctrl + Z Undo an action
Ctrl + Y Redo an action
Delete (or Ctrl + D) Delete the selected item and move it to the Recycle Bin
Shift + Delete Delete the selected item without moving it to the Recycle Bin first
F2 Rename the selected item
Ctrl + Right Arrow Move the cursor to the beginning of the next word
Ctrl + Left Arrow Move the cursor to the beginning of the previous word
Ctrl + Down Arrow Move the cursor to the beginning of the next paragraph
Ctrl + Up Arrow Move the cursor to the beginning of the previous paragraph
Ctrl + Shift with an arrow key Select a block of text
Shift + any arrow key Select more than one item in a window or on the desktop, or select text within a document
Ctrl + any arrow key + Spacebar Select multiple individual items in a window or on the desktop
Ctrl + A Select all items in a document or window
F3 Search for a file or folder
Alt + Enter Display properties for the selected item
Alt + F4 Close the active item, or exit the active program
Alt + Spacebar Open the shortcut menu for the active window
Ctrl + F4 Close the active document (in programs that allow you to have multiple documents open simultaneously)
Alt + Tab Switch between open items
Ctrl + Alt + Tab Use the arrow keys to switch between open items
Ctrl + Mouse scroll wheel Change the size of icons on the desktop
Windows logo key + Tab Cycle through programs on the taskbar by using Aero Flip 3-D
Ctrl+ Windows logo key + Tab Use the arrow keys to cycle through programs on the taskbar by using Aero Flip 3-D
Alt + Esc Cycle through items in the order in which they were opened
F6 Cycle through screen elements in a window or on the desktop
F4 Display the address bar list in Windows Explorer
Shift + F10 Display the shortcut menu for the selected item
Ctrl + Esc Open the Start menu
Alt + underlined letter Display the corresponding menu
Alt + underlined letter Perform the menu command (or other underlined command)
F10 Activate the menu bar in the active program
Right Arrow Open the next menu to the right, or open a submenu
Left Arrow Open the next menu to the left, or close a submenu
F5 (or Ctrl + R) Refresh the active window
Alt + Up Arrow View the folder one level up in Windows Explorer
Esc Cancel the current task
Ctrl + Shift + Esc Open Task Manager
Shift when you insert a CD Prevent the CD from automatically playing
Left Alt + Shift Switch the input language when multiple input languages are enabled
Ctrl + ShiftL Switch the keyboard layout when multiple keyboard layouts are enabled
Right or Left Ctrl + Shift Change the reading direction of text in right-to-left reading languages

Windows 7 Magnifier keyboard shortcut keys

Windows logo key + Plus Sign or Minus Sign Zoom in or out
Ctrl + Alt + Spacebar Preview the desktop in full-screen mode
Ctrl + Alt + F Switch to full-screen mode
Ctrl + Alt + L Switch to lens mode
Ctrl + Alt + D Switch to docked mode
Ctrl + Alt + I Invert colors
Ctrl + Alt + arrow keys Pan in the direction of the arrow keys
Ctrl + Alt + R Resize the lens
Windows logo key + Esc Exit Magnifier

Windows 7 Paint keyboard shortcut keys

Ctrl + N Create a new picture
Ctrl + O Open an existing picture
Ctrl + S Save changes to a picture
F12 Save the picture as a new file
Ctrl + P Print a picture
Alt + F4 Close a picture and its Paint window
Ctrl + Z Undo a change
Ctrl + Y Redo a change
Ctrl + A Select the entire picture
Ctrl + X Cut a selection
Ctrl + C Copy a selection to the Clipboard
Ctrl + V Paste a selection from the Clipboard
Right Arrow Move the selection or active shape right by one pixel
Left Arrow Move the selection or active shape left by one pixel
Down Arrow Move the selection or active shape down by one pixel
Up Arrow Move the selection or active shape up by one pixel
Esc Cancel a selection
Delete Delete a selection
Ctrl + B Bold selected text
Ctrl + + Increase the width of a brush, line, or shape outline by one pixel
Ctrl + - Decrease the width of a brush, line, or shape outline by one pixel
Ctrl + I Italicize selected text
Ctrl + U Underline selected text
Ctrl + E Open the Properties dialog box
Ctrl + W Open the Resize and Skew dialog box
Ctrl + Page Up Zoom in
Ctrl + Page Down Zoom out
F11 View a picture in full-screen mode
Ctrl + R Show or hide the ruler
Ctrl + G Show or hide gridlines
F10 or Alt Display keytips
Shift + F10 Show the current shortcut menu
F1 Open Paint Help

Windows 7 Remote Desktop Connection keyboard shortcut keys

Alt + Page Up Move between programs from left to right.
Alt + Page Down Move between programs from right to left.
Alt + Insert Cycle through programs in the order that they were started in.
Alt + Home Display the Start menu.
Ctrl + Alt + Break Switch between a window and full screen.
Ctrl + Alt + End Display the Windows Security dialog box.
Alt + Delete Display the system menu.
Ctrl + Alt + Minus Sign (-) on the numeric keypad Place a copy of the active window, within the client, on the Terminal server clipboard (provides the same functionality as pressing Alt + PrtScn on a local computer).
Ctrl + Alt + Plus Sign (+) on the numeric keypad Place a copy of the entire client window area on the Terminal server clipboard (provides the same functionality as pressing PrtScn on a local computer).
Ctrl + Alt + Right Arrow "Tab" out of the Remote Desktop controls to a control in the host program (for example, a button or a text box). Useful when the Remote Desktop controls are embedded in another (host) program.
Ctrl + Alt + Left Arrow "Tab" out of the Remote Desktop controls to a control in the host program (for example, a button or a text box). Useful when the Remote Desktop controls are embedded in another (host) program.

Windows 7 Taskbar keyboard shortcut keys

Shift + Click on a taskbar button Open a program or quickly open another instance of a program
Ctrl + Shift + Click on a taskbar button Open a program as an administrator
Shift + Right-click on a taskbar button Show the window menu for the program
Shift + Right-click on a grouped taskbar button Show the window menu for the group
Ctrl + Click on a grouped taskbar button Cycle through the windows of the group

Windows 7 Windows Explorer keyboard shortcut keys

Ctrl + N Open a new window
Ctrl + W Close the current window
Ctrl + Shift + N Create a new folder
End Display the bottom of the active window
Home Display the top of the active window
F11 Maximize or minimize the active window
Ctrl + Period (.) Rotate a picture clockwise
Ctrl + Comma (,) Rotate a picture counter-clockwise
Num Lock + Asterisk (*) on numeric keypad Display all subfolders under the selected folder
Num Lock + Plus Sign (+) on numeric keypad Display the contents of the selected folder
Num Lock + Minus Sign (-) on numeric keypad Collapse the selected folder
Left Arrow Collapse the current selection (if it's expanded), or select the parent folder
Alt + Enter Open the Properties dialog box for the selected item
Alt + P Display the preview pane
Alt + Left Arrow View the previous folder
Backspace View the previous folder
Right Arrow Display the current selection (if it's collapsed), or select the first subfolder
Alt + Right Arrow View the next folder
Alt + Up Arrow View the parent folder
Ctrl + Shift + E Display all folders above the selected folder
Ctrl + Mouse scroll wheel Change the size and appearance of file and folder icons
Alt + D Select the address bar
Ctrl + E Select the search box
Ctrl + F Select the search box

Windows 7 Windows logo key keyboard shortcut keys

Windows 7 Shortcut Key Action / Operation
Windows logo key Open or close the Start menu.
Windows logo key + Pause Display the System Properties dialog box.
Windows logo key + D Display the desktop.
Windows logo key + M Minimize all windows.
Windows logo key + Shift + M Restore minimized windows to the desktop.
Windows logo key + E Open Computer.
Windows logo key + F Search for a file or folder.
Ctrl + Windows logo key + F Search for computers (if you're on a network).
Windows logo key + L Lock your computer or switch users.
Windows logo key + R Open the Run dialog box.
Windows logo key + T Cycle through programs on the taskbar.
Windows logo key + number Start the program pinned to the taskbar in the position indicated by the number. If the program is already running, switch to that program.
Shift + Windows logo key + number Start a new instance of the program pinned to the taskbar in the position indicated by the number.
Ctrl + Windows logo key + number Switch to the last active window of the program pinned to the taskbar in the position indicated by the number.
Alt + Windows logo key + number Open the Jump List for the program pinned to the taskbar in the position indicated by the number.
Windows logo key + Tab Cycle through programs on the taskbar by using Aero Flip 3-D.
Ctrl+Windows logo key + Tab Use the arrow keys to cycle through programs on the taskbar by using Aero Flip 3-D.
Ctrl+Windows logo key + B Switch to the program that displayed a message in the notification area.
Windows logo key + Spacebar Preview the desktop.
Windows logo key + Up Arrow Maximize the window.
Windows logo key + Left Arrow Maximize the window to the left side of the screen.
Windows logo key + Right Arrow Maximize the window to the right side of the screen.
Windows logo key + Down Arrow Minimize the window.
Windows logo key + Home Minimize all but the active window.
Windows logo key + Shift + Up Arrow Stretch the window to the top and bottom of the screen.
Windows logo key + Shift+ Left Arrow or Right Arrow Move a window from one monitor to another.
Windows logo key + P Choose a presentation display mode.
Windows logo key + G Cycle through gadgets.
Windows logo key + U Open Ease of Access Center.
Windows logo key + X Open Windows Mobility Center.

Windows 7 Windows Journal keyboard shortcut keys

Ctrl + N Start a new note
Ctrl + O Open a recently used note
Ctrl + S Save changes to a note
Ctrl + Shift + V Move a note to a specific folder
Ctrl + P Print a note
Alt + F4 Close a note and its Journal window
Ctrl + Z Undo a change
Ctrl + Y Redo a change
Ctrl + A Select all items on a page
Ctrl + X Cut a selection
Ctrl + C Copy a selection to the Clipboard
Ctrl + V Paste a selection from the Clipboard
Esc Cancel a selection
Delete Delete a selection
Ctrl + F Start a basic find
Ctrl + G Go to a page
F5 Refresh find results
F5 Refresh the note list
F6 Toggle between a note list and a note
Ctrl + Shift + C Display a shortcut menu for column headings in a note list
F11 View a note in full-screen mode
F1 Open Journal Help

Windows 7 Windows Help viewer keyboard shortcut keys

Alt + C Display the Table of Contents
Alt + N Display the Connection Settings menu
F10 Display the Options menu
Alt + Left Arrow Move back to the previously viewed topic
Alt + Right Arrow Move forward to the next (previously viewed) topic
Alt + A Display the customer support page
Alt + Home Display the Help and Support home page
Home Move to the beginning of a topic
End Move to the end of a topic
Ctrl + F Search the current topic
Ctrl + P Print a topic
F3 Move the cursor to the search box

Windows 7 WordPad keyboard shortcut

Ctrl + N Create a new document
Ctrl + O Open an existing document
Ctrl + S Save changes to a document
F12 Save the document as a new file
Ctrl + P Print a document
Alt + F4 Close WordPad
Ctrl + Z Undo a change
Ctrl + Y Redo a change
Ctrl + A Select the entire document
Ctrl + X Cut a selection
Ctrl + C Copy a selection to the Clipboard
Ctrl + V Paste a selection from the Clipboard
Ctrl + B Make selected text bold
Ctrl + I Italicize selected text
Ctrl + U Underline selected text
Ctrl + = Make selected text subscript
Ctrl + Shift + = Make selected text superscript
Ctrl + L Align text left
Ctrl + E Align text center
Ctrl + R: Align text right
Ctrl + J Justify text
Ctrl + 1 Set single line spacing
Ctrl + 2 Set double line spacing
Ctrl + 5 Set line spacing to 1.5
Ctrl + Shift + > Increase the font size
Ctrl + Shift + < Decrease the font size
Ctrl + Shift + A Change characters to all capitals
Ctrl + Shift + L Change the bullet style
Ctrl + D Insert a Microsoft Paint drawing
Ctrl + F Find text in a document
F3 Find the next instance of the text in the Find dialog box
Ctrl + H Replace text in a document
Ctrl + Left Arrow Move the cursor one word to the left
Ctrl + Right Arrow Move the cursor one word to the right
Ctrl + Up Arrow Move the cursor to the line above
Ctrl + Down Arrow Move the cursor to the line below
Ctrl + Home Move to the beginning of the document
Ctrl + End Move to the end of the document
Ctrl + Page Up Move up one page
Ctrl + Page Down Move down one page
Ctrl + Delete Delete the next word
F10 Display keytips
Shift + F10 Show the current shortcut menu
F1 Open WordPad Help


Static Route in Windows

In Windows, to add a static route, the syntax is as below:

route add [destination network] mask [destination network mask] [default gateway] -p

Example:
route add 10.0.0.0 mask 255.255.255.0 192.168.1.1 -p

*Without "-p", the route will be erased upon next reboot.

To see the routing table:

route print

To delete the route:

route delete [network]

Example:

route delete 10.0.0.0

* Make a Batch file for easy.


Windows Recovery Console Commands

4:49 PM by Yash Kalra 0 comments

When dealing with a Blue Screen of Death at boot - the first option should be to boot into Safe Mode (press F8 during bootup). From safe mode you can run a system restore with %systemroot%\system32\restore\rstrui.exe

Some hardware failures are so severe they prevent booting into Safe Mode.

The recovery console allows an alternative boot option giving a limited command prompt - this can be used to disable services or replace system files until you are able to boot into safe mode.

Recovery Console commands:

ATTRIB   Change file attributes
BATCH    Execute a batch file
CD       Change directory
CHKDSK   Check Disk
CLS      Clear screen
COPY     Copy files*
DEL      Delete Files*
DIR      Directory listing
DISABLE  Disable Service
DISKPART Create or delete disk Partitions (like running setup)
ENABLE   Enable Service
EXIT     Quit the recovery console and reboot
EXPAND
FIXBOOT  Write a new boot sector to the system partition
FIXMBR   Repair the Master boot Record
FORMAT   FORMAT drive /FS:NTFS
HELP
LISTSVC  List all services and drivers
LOGON    Logon as administrator (local)
MAP      List local physical drive mappings
MAP arc  List local physical drive mappings(ARC path)
MD       Make Directory*
MORE
RD       Remove Directory*
REN      Rename file*
SYSTEMROOT Set the current directory to be %Systemroot%

* File operations are only possible on:
  system directories, floppy drive(removable media), Root directories,
  local install sources. You can copy FROM but not TO a floppy disk.

Installation:

The recovery console is not installed by default, from the install CD use the command: D:\i386\winnt32 /cmdcons
Then restart the machine.


TASKLIST

4:47 PM by Yash Kalra 0 comments

TaskList displays all running applications and services with their Process ID (PID) This can be run on either a local or a remote computer.

Syntax
      tasklist options

Options:

   /s computer  Name or IP address of a remote computer
                don't use backslashes. Default = local computer.

   /u domain\user [/p password]]
                Run under a different account

   /svc         List information for each process without truncation.
                Valid when /fo=TABLE. Cannot be used with /m or /v

   /m [ModuleName]
                Show the processes that include the given module.

   /v           Verbose task information

   /fo {TABLE|LIST|CSV}]
                Output format, the default is TABLE.

   /nh          No Headers in the output (does not apply to LIST output)

   /fi FilterName [/fi FilterName2 [ ... ]]
                Apply one of the Filters below:

                   Imagename   eq, ne                  String
                   PID         eq, ne, gt, lt, ge, le  Positive integer.
                   Session     eq, ne, gt, lt, ge, le  Any valid session number.
                   SessionName eq, ne                  String
                   Status      eq, ne                  RUNNING | NOT RESPONDING
                   CPUTime     eq, ne, gt, lt, ge, le  Time hh:mm:ss
                   MemUsage    eq, ne, gt, lt, ge, le  Any valid integer.
                   Username    eq, ne                  User name ([Domain\]User).
                   Services    eq, ne                  String
                   Windowtitle eq, ne                  String
                   Modules     eq, ne                  String

Examples:

List the services running under each process:

TASKLIST /svc

List the services running under each SvcHost process:

TASKLIST /FI "imagename eq svchost.exe" /svc

List the services running now:

TASKLIST /v /fi "STATUS eq running"

List the services running under a specific user account:

TASKLIST /v /fi "username eq SERVICE_ACCT05"


SC (Service Control)

4:45 PM by Yash Kalra 0 comments

Service Control - Create, Start, Stop, Query or Delete any Windows SERVICE. The command options for SC are case sensitive.

Syntax
      SC [\\server] [command] [service_name] [Options]

Key
   server       : The machine where the service is running

   service_name : The KeyName of the service, this is often but not always
                  the same as the DisplayName shown in Control Panel, Services.
                  You can get the KeyName by running: 
                     SC GetKeyName <DisplayName>

   commands:
          query  [qryOpt]   Show status
          queryEx [qryOpt]  Show extended info - pid, flags
          GetDisplayName    Show the DisplayName
          GetKeyName        Show the ServiceKeyName
          EnumDepend        Show Dependencies
          qc                Show config - dependencies, full path etc
          start          START a service.
          stop           STOP a service
          pause          PAUSE a service.
          continue       CONTINUE a service.
          create         Create a service. (add it to the registry)
          config         permanently change the service configuration
          delete         Delete a service (from the registry)
          control        Send a control to a service
          interrogate    Send an INTERROGATE control request to a service
          Qdescription   Query the description of a service
          description    Change the description of a service
          Qfailure       Query the actions taken by a service upon failure
          failure        Change the actions taken by a service upon failure
          sdShow         Display a service's security descriptor using SDDL
          SdSet          Sets a service's security descriptor using SDDL

   qryOpt:
          type= driver|service|all
                         Query specific types of service
          state= active|inactive|all
                         Query services in a particular state only
          bufsize= bytes 
          ri= resume_index_number (default=0)
          group= groupname
                         Query services in a particular group

   Misc commands that don't require a service name:
          SC  QueryLock  Query the LockStatus for the ServiceManager Database.
                         this will show if a service request is running
          SC  Lock       Lock the Service Database
          SC  BOOT       Values are {ok | bad} Indicates whether to save  
                         the last restart configuration as the `last-known-good`
                         restart configuration
   Options
     The CREATE and CONFIG commands allow additional options to be set
     see the build-in help: 'SC create' and 'SC config'

Note the qryOpt options above are case sensitive - they must be entered in lower case, also the position of spaces and = must be exactly as shown.

The SC command duplicates some aspects of the NET command but adds the ability to create a service.
SC query will display if a service is running, giving output like this:

        SERVICE_NAME       : messenger
        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

To retrieve specific information from SC's output, pipe into FIND or FindStr
e.g.

  C:\> SC query messenger | FIND "STATE" | FIND "STOPPED"

  C:\> SC query messenger | FIND "STATE" | FIND "RUNNING"

The statements above will return an %ERRORLEVEL% = 1 if the text is not found

IF errorlevel 1 GOTO :my_subroutine

The NET START command can be used in a similar way to check if a service is running:

   NET START | FIND "Service name" > nul
   IF errorlevel 1 ECHO The service is not running

The service control manager will normally wait up to 30 seconds to allow a service to start - you can modify this time (30,000 milliseconds) in the registry

HKLM\SYSTEM\CurrentControlSet\Control
ServicesPipeTimeout (REG_DWORD)

Some options only take effect at the point when the service is started e.g. the SC config command allows the executable of a service to be changed. When the service next starts up it will run the new executable. Config changes requires the current user to have "permission to configure the service".

Examples:

 SC GetKeyName "task scheduler"
 SC GetDisplayName schedule 
 SC start schedule
 SC QUERY schedule
 SC QUERY type= driver
 SC QUERY state= all |findstr "DISPLAY_NAME STATE" >svc_installed.txt 
 SC \\myServer CONFIG myService obj= LocalSystem password= mypassword
 SC CONFIG MyService binPath=c:\myprogram.exe obj=".\LocalSystem" password=""  

Watch out for extra spaces:
SC QUERY state= all Works
SC QUERY sTate =all Fails!


Missing or Corrupt Windows System File

2:20 PM by Yash Kalra 0 comments

The most common errors during windows xp boot-up.

Steps:-

Windows XP Installer CD to boot from.

1. Set CD-DVD drive as the first boot device in your BIOS.

2. Insert windows xp installer cd and boot from it and press any key when prompted.

3. When initialization is complete (that is after windows starting message), press R to repair.

4. Select the windows installation you wan to repair from the list, normally it's number 1 then hit enter key.

5. When presented with the c:\ prompt, do the following commands.


c:\> ren c:\windows\system32\config\system system.old
c:\> copy c:\windows\repair\system c:\windows\system32\config
c:\> fixboot

6. Remove CD and restart your computer.


Windows 7 WinSxS Folder Size reduce

1:51 PM by Yash Kalra 0 comments

With Windows Vista, the WinSxS folder was able to be cleaned up via a third party tool (WinSxS Lite here - Vista only!). With the initial release of Windows 7, we lost that capability - but it has since returned with Service Pack 1.

The WinSxS folder is used to store install and uninstall files, windows packages (current and previous versions of a component) and out-of-band releases. (You should not completely delete this folder). Post Windows 7 SP1, there is now a way to remove the unnecessary files from this folder using the command line (elevated/admin mode -> Click Start -> Type "cmd" in Search. Right click on "cmd" and choose "Run as Administrator"). This is great for reducing the Windows folder size for SSDs and netbooks.

c:\dism /online /cleanup-image /spsuperseded


Install the Windows Recovery Console in Boot Menu

1:44 PM by Yash Kalra 0 comments

The Windows Recovery Console is required to fix many startup issues caused by malware, viruses, and corrupt system files. The Recovery Console can be booted from the Windows Setup disc, but many machines (including Netbooks) do not have CD drives or easy access to the Windows Setup disc.

Below are the instructions to install the Recovery Console on any Windows XP machine as a boot list option. You will no longer need physical access to the Windows Setup disc (except to install initially) when things go wrong.

  • Insert the Windows XP setup disc.
  • Click Start -> Run and type: "%windir%\i386\winnt32.exe /cmdcons"
  • Click YES on the Windows Setup box to install the Recovery Console.
  • Setup will attempt to connect to the Internet to update any setup files from the disc. Press ESC to interrupt the setup and use the files on the disc only.
  • Once the Recovery Console is installed a confirmation box will pop up. Click OK.

Some Windows XP passwords will not be recognized by the Recovery Console. To remove the password requirement, modify the following registry key:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Setup\RecoveryConsole
  • Set the DWORD SecurityLevel value to 1.


TCP/IP Configure from the Command Prompt

Netsh.exe is a command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a computer that is currently running. Netsh.exe also provides a scripting feature that allows you to run a group of commands in batch mode against a specified computer. Netsh.exe can also save a configuration script in a text file for archival purposes or to help you configure other servers.

Netsh.exe is available on Windows 2000, Windows XP and Windows Server 2003.

You can use the Netsh.exe tool to perform the following tasks:

  • Configure interfaces
  • Configure routing protocols
  • Configure filters
  • Configure routes
  • Configure remote access behavior for Windows-based remote access routers that are running the Routing and Remote Access Server (RRAS) Service
  • Display the configuration of a currently running router on any computer
  • Use the scripting feature to run a collection of commands in batch mode against a specified router.

What can we do with Netsh.exe?

With Netsh.exe you can easily view your TCP/IP settings. Type the following command in a Command Prompt window (CMD.EXE):
netsh interface ip show config


With Netsh.exe, you can easily configure your computer's IP address and other TCP/IP related settings.
For example:

The following command configures the interface named Local Area Connection with the static IP address 192.168.0.100, the subnet mask of 255.255.255.0, and a default gateway of 192.168.0.1:
netsh interface ip set address name="Local Area Connection" static 192.168.0.100 255.255.255.0 192.168.0.1 1
(The above line is one long line, copy paste it as one line)

Netsh.exe can be also useful in certain scenarios such as when you have a portable computer that needs to be relocated between 2 or more office locations, while still maintaining a specific and static IP address configuration. With Netsh.exe, you can easily save and restore the appropriate network configuration.

First, connect your portable computer to location #1, and then manually configure the required settings (such as the IP address, Subnet Mask, Default Gateway, DNS and WINS addresses).

Now, you need to export your current IP settings to a text file. Use the following command:

netsh -c interface dump > c:'location1.txt

When you reach location #2, do the same thing, only keep the new settings to a different file:

netsh -c interface dump > c:'location2.txt
You can go on with any other location you may need, but we'll keep it simple and only use 2 examples.

Now, whenever you need to quickly import your IP settings and change them between location #1 and location #2, just enter the following command in a Command Prompt window (CMD.EXE):
netsh -f c:'location1.txt
or
netsh -f c:'location2.txt
and so on.
You can also use the global EXEC switch instead of -F:
netsh exec c:'location2.txt

Netsh.exe can also be used to configure your NIC to automatically obtain an IP address from a DHCP server:
netsh interface ip set address "Local Area Connection" dhcp

Would you like to configure DNS and WINS addresses from the Command Prompt? You can. See this example for DNS:
netsh interface ip set dns "Local Area Connection" static 192.168.0.200
and this one for WINS:
netsh interface ip set wins "Local Area Connection" static 192.168.0.200
Or, if you want, you can configure your NIC to dynamically obtain it's DNS settings:
netsh interface ip set dns "Local Area Connection" dhcp
BTW, if you want to set a primary and secondary DNS address, add index=1 and index=2 respectively to the lines of Netsh command.

Source


Configure IP Address & DNS from Command

6:47 PM by Yash Kalra 0 comments

To configure TCP/IP settings such as the IP address, Subnet Mask, Default Gateway, DNS and WINS addresses and many other options you can use Netsh.exe.

netsh interface ip set address name="Local Area Connection" static 123.123.123.123 255.255.255.0 123.123.123.1 1

Local Area Connection is the name of the adapter you want to modify. In single NIC systems it is normally called Local Area Connection.

123.123.123.123 is the IP address you want to set.

255.255.255.0 is the subnet mask.

123.123.123.1 is the gateway.

1 is the gateway metric. You can leave this as 1 for almost all cases.

If you want to enable DHCP you can run:

netsh interface ip set address name="Local Area Connection" dhcp

There are two commands for DNS since administrators typically configure a primary and secondary DNS server.

For the primary DNS run:

netsh interface ip set dns name="Local Area Connection" static 208.67.222.222

For the secondary run:

netsh interface ip add dns name="Local Area Connection" 208.67.220.220 index=2

If you want to configure the computer to use DNS from DHCP run:

netsh interface ip set dnsservers name="Local Area Connection" source=dhcp

When you are finished with all of your IP and DNS changes run ipconfig -all to review the new settings.


Enable Port Forwarding on Router

6:12 PM by Yash Kalra 0 comments

NAT

I am making an assumption that you are doing nat overload. If this is
the case, then you would simply add

ip nat inside source static udp 192.168.1.1 43398 65.65.65.65 43398

in the above example, 192.168.1.1 is the inside address of the device
you want to port forwarded to and 65.65.65.65 is a public ip address
that you have available (it could even be the ip address of the outside
interface.

ACCESS LIST

To open Remote Desktop Connection port 3389. You need an access list on the router.

access-list 101 permit ip 199.99.99.99 0.0.0.0 192.168.1.2 0.0.0.0 eq 3389
access-list 101 deny ip 199.99.99.99 0.0.0.0 192.168.1.0 0.0.0.255
access-list 101 permit any any

Change the 199 address to your public IP and the 192 to your LAN IP on the first listing. Leave the rest alone.

If you want to allow the port 43398 to be send out

You can use extended access list and implement it on the incomming and outgoing interface of your router

access-list 101 permit udp 192.168.1.1 eq 43398 65.65.65.65 43398
access-list 101 permit udp 65.65.65.65 eq 43398 192.168.1.1 43398


for both direction as router needs access to be defined for both direction.


Password Remember for Map Network Drive

5:33 PM by Yash Kalra 0 comments

Create a Batch file with this line:

net use DRIVE: \\SERVERNAME\FOLDERNAME PASSWORD /user:USERNAME /persistent:yes

then put this file into startup!!


De-crypt Encrypted files

4:48 PM by Yash Kalra 0 comments

De-crypt Encrypted files

1. Login as Administrator

2. Go to Start/Run and type in cmd and click OK.

At the prompt type cipher /r:Eagent and press enter

This prompt will then display:

Please type in the password to protect your .PFX file:

Type in your Administrator password
Re-confirm your Administrator password

The prompt will then display

Your .CER file was created successfully.
Your .PFX file was created successfully.

The Eagent.cer and Eagent.pfx files will be saved in the current directory that is shown at the command prompt. Example: The command prompt displays C:\Documents and Settings\admin> the two files are saved in the admin folder. (For security concerns, you should house the two files in your Administrator folder or on a floppy disk).

3. Go to Start/Run and type in certmgr.msc and click OK. This will launch the Certificates Manager. Navigate to Personal and right click on the folder and select All Tasks/Import. The Certificate Import Wizard will appear. Click Next. Browse to the C:\Documents and Settings\admin folder. In the Open dialog box, change the Files of Type (at the bottom) to personal Information Exchange (*.pfx,*.P12). Select the file Eagent.pfx and click Open. Click Next. Type in your Administrator password (leave the two checkboxes blank) and click Next. Make sure the Radio button is active for the first option (Automatically select the certificate store based on the type of certifcate). Click Next. Click Finish. (You'll receive a message that the import was successful). To confirm the import, close Certificates Manager and re-open it. Expand the Personal folder and you will see a new subfolder labeled Certificates. Expand that folder and you will see the new entry in the right side column. Close Certificate Manager.

4. Go to Start/Run and type in secpol.msc and click OK. This will launch the Local Security Policy. Expand the Public Key Policies folder and then right click on the Encrypted File System subfolder and select Add Data Recovery Agent... The Wizard will then display. Click Next. Click the Browse Folders... button. Browse to the C:\Documents and Settings\admin folder. Select the Eagent.cer file and click Open. (The wizard will display the status User_Unknown. That's ok). Click Next. Click Finish. You will see a new entry in the right side column. Close the Local Security Policy.

You, the Administrator are now configured as the default Recovery Agent for All Encrypted files on the Local Machine.

To Recover Encrypted files:

Scenario #1

If you have completed the above steps BEFORE an existing user encrypted his/her files, you can log in to your Administrator account and navigate to the encrypted file(s). Double click on the file(s) to view the contents.

Scenario #2

If you have completed the above steps AFTER an existing user has already encrypted his/her files, you must login to the applicable User's User Account and then immediately logout. Next, login to your Administrator account and navigate to the encrypted file(s). Double click on the file(s) to view the contents.


*Warning

Do not Delete or Rename a User's account from which will want to Recover the Encrypted Files. You will not be able to de-crypt the files using the steps outlined above.

Source


Usefull Commands

Run Commands:-
compmgmt.msc - Computer management
devmgmt.msc - Device manager
diskmgmt.msc - Disk management
dfrg.msc - Disk defrag
eventvwr.msc - Event viewer
fsmgmt.msc - Shared folders
gpedit.msc - Group policies
lusrmgr.msc - Local users and groups
perfmon.msc - Performance monitor
rsop.msc - Resultant set of policies
secpol.msc - Local security settings
services.msc - Various Services
msconfig - System Configuration Utility
regedit - Registry Editor
msinfo32 _ System Information
sysedit _ System Edit
win.ini _ windows loading information(also system.ini)
winver _ Shows current version of windows
mailto: _ Opens default email client
command _ Opens command prompt

Run Commands to access the control panel:-
appwiz.cpl -Add/Remove Programs control
timedate.cpl -Date/Time Properties control
desk.cpl -Display Properties control
findfast.cpl -FindFast control
inetcpl.cpl -Internet Properties control
main.cpl keyboard -Keyboard Properties control
main.cpl -Mouse Properties control
mmsys.cpl -Multimedia Properties control
netcpl.cpl -Network Properties control
password.cpl -Password Properties control
mmsys.cpl sounds -Sound Properties control
sysdm.cpl -System Properties control

Command Prompt:-

ANSI.SYS Defines functions that change display graphics, control cursor movement, and reassign keys.
APPEND Causes MS-DOS to look in other directories when editing a file or running a command.
ARP Displays, adds, and removes arp information from network devices.
ASSIGN Assign a drive letter to an alternate letter.
ASSOC View the file associations.
AT Schedule a time to execute commands or programs.
ATMADM Lists connections and addresses seen by Windows ATM call manager.
ATTRIB Display and change file attributes.
BATCH Recovery console command that executes a series of commands in a file.
BOOTCFG Recovery console command that allows a user to view, modify, and rebuild the boot.ini
BREAK Enable / disable CTRL + C feature.
CACLS View and modify file ACL's.
CALL Calls a batch file from another batch file.
CD Changes directories.
CHCP Supplement the International keyboard and character set information.
CHDIR Changes directories.
CHKDSK Check the hard disk drive running FAT for errors.
CHKNTFS Check the hard disk drive running NTFS for errors.
CHOICE Specify a listing of multiple options within a batch file.
CLS Clears the screen.
CMD Opens the command interpreter.
COLOR Easily change the foreground and background color of the MS-DOS window.
COMP Compares files.
COMPACT Compresses and uncompress files.
CONTROL Open control panel icons from the MS-DOS prompt.
CONVERT Convert FAT to NTFS.
COPY Copy one or more files to an alternate location.
CTTY Change the computers input/output devices.
DATE View or change the systems date.
DEBUG Debug utility to create assembly programs to modify hardware settings.
DEFRAG Re-arrange the hard disk drive to help with loading programs.
DEL Deletes one or more files.
DELETE Recovery console command that deletes a file.
DELTREE Deletes one or more files and/or directories.
DIR List the contents of one or more directory.
DISABLE Recovery console command that disables Windows system services or drivers.
DISKCOMP Compare a disk with another disk.
DISKCOPY Copy the contents of one disk and place them on another disk.
DOSKEY Command to view and execute commands that have been run in the past.
DOSSHELL A GUI to help with early MS-DOS users.
DRIVPARM Enables overwrite of original device drivers.
ECHO Displays messages and enables and disables echo.
EDIT View and edit files.
EDLIN View and edit files.
EMM386 Load extended Memory Manager.
ENABLE Recovery console command to enable a disable service or driver.
ENDLOCAL Stops the localization of the environment changes enabled by the setlocal command.
ERASE Erase files from computer.
EXIT Exit from the command interpreter.
EXPAND Expand a M*cros*ft Windows file back to it's original format.
EXTRACT Extract files from the M*cros*ft Windows cabinets.
FASTHELP Displays a listing of MS-DOS commands and information about them.
FC Compare files.
FDISK Utility used to create partitions on the hard disk drive.
FIND Search for text within a file.
FINDSTR Searches for a string of text within a file.
FIXBOOT Writes a new boot sector.
FIXMBR Writes a new boot record to a disk drive.
FOR Boolean used in batch files.
FORMAT Command to erase and prepare a disk drive.
FTP Command to connect and operate on a FTP server.
FTYPE Displays or modifies file types used in file extension associations.
GOTO Moves a batch file to a specific label or location.
GRAFTABL Show extended characters in graphics mode.
HELP Display a listing of commands and brief explanation.
IF Allows for batch files to perform conditional processing.
IFSHLP.SYS 32-bit file manager.
IPCONFIG Network command to view network adapter settings and assigned values.
KEYB Change layout of keyboard.
LABEL Change the label of a disk drive.
LH Load a device driver in to high memory.
LISTSVC Recovery console command that displays the services and drivers.
LOADFIX Load a program above the first 64k.
LOADHIGH Load a device driver in to high memory.
LOCK Lock the hard disk drive.
LOGON Recovery console command to list installations and enable administrator login.
MAP Displays the device name of a drive.
MD Command to create a new directory.
MEM Display memory on system.
MKDIR Command to create a new directory.
MODE Modify the port or display settings.
MORE Display one page at a time.
MOVE Move one or more files from one directory to another directory.
MSAV Early M*cros*ft Virus scanner.
MSD Diagnostics utility.
MSCDEX Utility used to load and provide access to the CD-ROM.
NBTSTAT Displays protocol statistics and current TCP/IP connections using NBT
NET Update, fix, or view the network or network settings
NETSH Configure dynamic and static network information from MS-DOS.
NETSTAT Display the TCP/IP network protocol statistics and information.
NLSFUNC Load country specific information.
NSLOOKUP Look up an IP address of a domain or host on a network.
PATH View and modify the computers path location.
PATHPING View and locate locations of network latency.
PAUSE Command used in batch files to stop the processing of a command.
PING Test / send information to another network computer or network device.
POPD Changes to the directory or network path stored by the pushd command.
POWER Conserve power with computer portables.
PRINT Prints data to a printer port.
PROMPT View and change the MS-DOS prompt.
PUSHD Stores a directory or network path in memory so it can be returned to at any time.
QBASIC Open the QBasic.
RD Removes an empty directory.
REN Renames a file or directory.
RENAME Renames a file or directory.
RMDIR Removes an empty directory.
ROUTE View and configure windows network route tables.
RUNAS Enables a user to execute a program on another computer.
SCANDISK Run the scandisk utility.
SCANREG Scan registry and recover registry from errors.
SET Change one variable or string to another.
SETLOCAL Enables local environments to be changed without affecting anything else.
SETVER Change MS-DOS version to trick older MS-DOS programs.
SHARE Installs support for file sharing and locking capabilities.
SHIFT Changes the position of replaceable parameters in a batch program.
SHUTDOWN Shutdown the computer from the MS-DOS prompt.
SMARTDRV Create a disk cache in conventional memory or extended memory.
SORT Sorts the input and displays the output to the screen.
START Start a separate window in Windows from the MS-DOS prompt.
SUBST Substitute a folder on your computer for another drive letter.
SWITCHES Remove add functions from MS-DOS.
SYS Transfer system files to disk drive.
TELNET Telnet to another computer / device from the prompt.
TIME View or modify the system time.
TITLE Change the title of their MS-DOS window.
TRACERT Visually view a network packets route across a network.
TREE View a visual tree of the hard disk drive.
TYPE Display the contents of a file.
UNDELETE Undelete a file that has been deleted.
UNFORMAT Unformat a hard disk drive.
UNLOCK Unlock a disk drive.
VER Display the version information.
VERIFY Enables or disables the feature to determine if files have been written properly.
VOL Displays the volume information about the designated drive.
XCOPY Copy multiple files, directories, and/or drives from one location to another.
TRUENAME When placed before a file, will display the whole directory in which it exists
TASKKILL It allows you to kill those unneeded or locked up applications