Translate

Friday 5 September 2014

Run Multiple Commands In One Go

   

Our final trick of the day is one that many command line geeks may already know, the
ability to run multiple command at once by linking them with double ampersands.
You can do this with any commands and you can link up as many as you want:
 
ipconfig && netstat

View Your Hard Drive's Entire Directory Structure

Directory Structure with Tree Command - Command Prompt Tricks
I think one of the neatest little commands is the tree command. With tree, you can create a kind of map of your computer's directories.
Execute tree from any directory to see the folder structure under that directory.
Tip: With so much information, it's probably a good idea to export the results of the tree command to a file. For example, tree /a > c:\treeresults.txt,

Save a Command's Output to a File

Command Output - Command Prompt Tricks
An incredibly useful Command Prompt trick is the use of redirection operators, specifically the > and >> operators.
These little characters let you redirect the output of a command to a file, giving you a saved version of whatever data the command produced in the Command Prompt window.
Let's say you're about to post a computer problem to an online forum, like my computer support forum for example, and you want to provide really accurate information about your computer. An easy way to do that would be to use the systeminfo command with a redirection operator.
For example, you might execute systeminfo > c:\mycomputerinfo.txtto save the information provided by the systeminfo command to a file. You could then attach the file to your forum post.

Become a Command Prompt Power User with Function Keys


Command Prompt Function Keys - Command Prompt Tricks
The fact that the function keys actually do something in the Command Prompt is maybe one of the best kept secrets about the tool:
F1: Pastes the last executed command (character by character)
F2: Pastes the last executed command (up to the entered character)
F3: Pastes the last executed command
F4: Deletes current prompt text up to the entered character
F5: Pastes recently executed commands (does not cycle)
F6: Pastes ^Z to the prompt
F7: Displays a selectable list of previously executed commands
F8: Pastes recently executed commands (cycles)
F9: Asks for the number of the command from the F7 list to paste
Command Prompt Trick #17 is full of arrow key shortcuts, a few of which are similar to these function key tricks.

Know if someone is hacking your computer/ Trace a Hacker


Want to know if someone is hacking your computer? Command Prompt can help you find if someone you don't know is connected to your computer stealing private data. Just execute netstat -a and the command prompt will return a list of computers that your computer is connected to. In the results returned, Proto column gives the type of data transmission taking place (TCP or UDP) , Local address column gives the port with which your computer is connected to an external computer and the Foreign Address column gives the external computer you are connected to along with the port being used for the connection. State gives the state of the connection (whether a connection is actually established, or waiting for transmission or is “Timed Out”).

Windows CMD Commands - CMD Network Commands


This document is under the: GNU Free Documentation License

Windows  CMD  (Command prompt) DOS

The Windows Command line interface can be accessed by running the CMD.exe that is located in the "system32" folder in you Windows folder.

The most common way to access this interface is to type "cmd" in the run dialoge box, then click the ok button

The most common basic & advanced commands in alphabetical order are:

A

ADDUSERS Add or list users to/from a CSV file
   ARP      Address Resolution Protocol
   ASSOC    Change file extension associations*
   ASSOCIAT One step file association
   ATTRIB   Change file attributes
B
   BOOTCFG  Edit Windows boot settings
   BROWSTAT Get domain, browser and PDC info
C
   CACLS    Change file permissions
   CALL     Call one batch program from another*
   CD       Change Directory - move to a specific Folder*
   CHANGE   Change Terminal Server Session properties
   CHKDSK   Check Disk - check and repair disk problems
   CHKNTFS  Check the NTFS file system
   CHOICE   Accept keyboard input to a batch file
   CIPHER   Encrypt or Decrypt files/folders
   CleanMgr Automated cleanup of Temp files, recycle bin
   CLEARMEM Clear memory leaks
   CLIP     Copy STDIN to the Windows clipboard.
   CLS      Clears command screen*
   CLUSTER  Windows Clustering
   CMD      Start a new CMD shell
   COLOR    Change colors of the CMD window*
   COMP     Compare the contents of two files or sets of files
   COMPACT  Compress files or folders on an NTFS partition
   COMPRESS Compress individual files on an NTFS partition
   CON2PRT  Connect or disconnect a Printer
   CONVERT  Convert a FAT drive to NTFS.
   COPY     Copy one or more files to another location*
   CSCcmd   Client-side caching (Offline Files)
   CSVDE    Import or Export Active Directory data
D
   DATE     Display or set the date*
   DEFRAG   Defragment hard drive
   DEL      Delete one or more files*
   DELPROF  Delete NT user profiles
   DELTREE  Delete a folder and all subfolders
   DevCon   Device Manager Command Line Utility
   DIR      Display a list of files and folders*
   DIRUSE   Display disk usage
   DISKCOMP Compare the contents of two floppy disks
   DISKCOPY Copy the contents of one floppy disk to another
   DISKPART Disk Administration
   DNSSTAT  DNS Statistics
   DOSKEY   Edit command line, recall commands, and create macros
   DSADD    Add user (computer, group..) to active directory
   DSQUERY  List items in active directory
   DSMOD    Modify user (computer, group..) in active directory
   DSRM     Remove items from Active Directory
E
   ECHO     Display message on screen*
   ENDLOCAL End localisation of environment changes in a batch file*
   ERASE    Delete one or more files*
   EXIT     Quit the current script/routine and set an errorlevel*
   EXPAND   Uncompress files
   EXTRACT  Uncompress CAB files
F
   FC       Compare two files
   FIND     Search for a text string in a file
   FINDSTR  Search for strings in files
   FOR /F   Loop command: against a set of files*
   FOR /F   Loop command: against the results of another command*
   FOR      Loop command: all options Files, Directory, List*
   FORFILES Batch process multiple files
   FORMAT   Format a disk
   FREEDISK Check free disk space (in bytes)
   FSUTIL   File and Volume utilities
   FTP      File Transfer Protocol
   FTYPE    Display or modify file types used in file extension associations*
G
   GLOBAL   Display membership of global groups
   GOTO     Direct a batch program to jump to a labelled line*
H
   HELP     Online Help
I
   iCACLS   Change file and folder permissions
   IF       Conditionally perform a command*
   IFMEMBER Is the current user in an NT Workgroup
   IPCONFIG Configure IP
K
   KILL     Remove a program from memory
L
   LABEL    Edit a disk label
   LOCAL    Display membership of local groups
   LOGEVENT Write text to the NT event viewer.
   LOGOFF   Log a user off
   LOGTIME  Log the date and time in a file
M
   MAPISEND Send email from the command line
   MBSAcli  Baseline Security Analyzer.
   MEM      Display memory usage
   MD   or MKDIR    Create new folders*
   MKLINK   Create a symbolic link (linkd)
   MODE     Configure a system device
   MORE     Display output, one screen at a time
   MOUNTVOL Manage a volume mount point
   MOVE     Move files from one folder to another*
   MOVEUSER Move a user from one domain to another
   MSG      Send a message
   MSIEXEC  Microsoft Windows Installer
   MSINFO   Windows NT diagnostics
   MSTSC    Terminal Server Connection (Remote Desktop Protocol)
   MUNGE    Find and Replace text within file(s)
   MV       Copy in-use files
N
   NET      Manage network resources
   NETDOM   Domain Manager
   NETSH    Configure Network Interfaces, Windows Firewall & Remote access
   NETSVC   Command-line Service Controller
   NBTSTAT  Display networking statistics (NetBIOS over TCP/IP)
   NETSTAT  Display networking statistics (TCP/IP)
   NOW      Display the current Date and Time
   NSLOOKUP Name server lookup
   NTBACKUP Backup folders to tape
   NTRIGHTS Edit user account rights
P
   PATH     Display or set a search path for executable files*
   PATHPING Trace route plus network latency and packet loss
   PAUSE    Suspend processing of a batch file and display a message*
   PERMS    Show permissions for a user
   PERFMON  Performance Monitor
   PING     Test a network connection
   POPD     Restore the previous value of the current directory saved by PUSHD*
   PORTQRY  Display the status of ports and services
   POWERCFG Configure power settings
   PRINT    Print a text file
   PRNCNFG  Display, configure or rename a printer
   PRNMNGR  Add, delete, list printers set the default printer
   PROMPT   Change the command prompt*
   PsExec     Execute process remotely
   PsFile     Show files opened remotely
   PsGetSid   Display the SID of a computer or a user
   PsInfo     List information about a system
   PsKill     Kill processes by name or process ID
   PsList     List detailed information about processes
   PsLoggedOn Who's logged on (locally or via resource sharing)
   PsLogList  Event log records
   PsPasswd   Change account password
   PsService  View and control services
   PsShutdown Shutdown or reboot a computer
   PsSuspend  Suspend processes
   PUSHD    Save and then change the current directory*
Q
   QGREP    Search file(s) for lines that match a given pattern.
R
   RASDIAL  Manage RAS connections
   RASPHONE Manage RAS connections
   RECOVER  Recover a damaged file from a defective disk.
   REG      Registry: Read, Set, Export, Delete keys and values
   REGEDIT  Import or export registry settings
   REGSVR32 Register or unregister a DLL
   REGINI   Change Registry Permissions
   REM      Record comments (remarks) in a batch file*
   REN      Rename a file or files*
   REPLACE  Replace or update one file with another
   RD or RMDIR      Delete folder(s)*
   RMTSHARE Share a folder or a printer
   ROBOCOPY Robust File and Folder Copy
   ROUTE    Manipulate network routing tables
   RUNAS    Execute a program under a different user account
   RUNDLL32 Run a DLL command (add/remove print connections)
S
   SC       Service Control
   SCHTASKS Schedule a command to run at a specific time
   SCLIST   Display NT Services
   SET      Display, set, or remove environment variables*
   SETLOCAL Control the visibility of environment variables*
   SETX     Set environment variables permanently
   SHARE    List or edit a file share or print share
   SHIFT    Shift the position of replaceable parameters in a batch file*
   SHORTCUT Create a windows shortcut (.LNK file)
   SHOWGRPS List the NT Workgroups a user has joined
   SHOWMBRS List the Users who are members of a Workgroup
   SHUTDOWN Shutdown the computer
   SLEEP    Wait for x seconds
   SLMGR    Software Licensing Management (Vista/2008)
   SOON     Schedule a command to run in the near future
   SORT     Sort input
   START    Start a program or command in a separate window*
   SU       Switch User
   SUBINACL Edit file and folder Permissions, Ownership and Domain
   SUBST    Associate a path with a drive letter
   SYSTEMINFO List system configuration
T
   TASKLIST List running applications and services
   TASKKILL Remove a running process from memory
   TIME     Display or set the system time*
   TIMEOUT  Delay processing of a batch file
   TITLE    Set the window title for a CMD.EXE session*
   TLIST    Task list with full path
   TOUCH    Change file timestamps  
   TRACERT  Trace route to a remote host
   TREE     Graphical display of folder structure
   TYPE     Display the contents of a text file*
U
   USRSTAT  List domain usernames and last login
V
   VER      Display version information*
   VERIFY   Verify that files have been saved*
   VOL      Display a disk label*
W
   WHERE    Locate and display files in a directory tree
   WHOAMI   Output the current UserName and domain
   WINDIFF  Compare the contents of two files or sets of files
   WINMSD   Windows system diagnostics
   WINMSDP  Windows system diagnostics II
   WMIC     WMI Commands
X
   XCACLS   Change file and folder permissions
   XCOPY    Copy files and folders
   ::       Comment / Remark*

* These commands are built into the CMD Shell, all others are seperate exe files that are cmd based apps that can be run from other software other than CMD.

Monday 1 September 2014

How to create a new user account using Command Prompt?


This tutorial describes how to create a new user account in the Windows operating system using Command Prompt. The guide is helpful when dealing with ransomware or fake antivirus programs that block Safe Mode and Safe Mode with Networking. Cyber criminals responsible for developing malicious programs develop new methods to protect their bogus software from elimination - this includes blocking users' access to Safe Mode.
When dealing with security threats such as these, it is advisable to log out of the infected user account and run a security scan from an unaffected account. This, however, is only possible if your operating system has multiple active user accounts. If you computer is infected with a ransomware infection, and you cannot create a new user account using Control Panel, then use the following instructions:
1. Start your computer in Safe Mode with Command Prompt. During your computer start process, press the F8 key on your keyboard multiple times until the Windows Advanced Options menu appears, then select Safe mode with Command Prompt from the list and press ENTER.
Boot your computer in Safe Mode with Command Prompt
2. When Command Prompt Mode loads, enter the following line: net user removevirus /add and press ENTER.
net user removevirus /add
3. Next, enter this line: net localgroup administrators removevirus /add and press ENTER.
creating new user using command prompt
4. Finally, enter this line: shutdown -r and press ENTER.
adding a new user in command prompt
5. Wait for your computer to restart, then boot your PC in Normal Mode and login to the newly-created user account ('removevirus'). This account will be unaffected by security infections and you will be able to download and install security software.
new user account win 7 and win xp
6. Use recommended malware removal software for detection and removal any security-related issues from your computer.
Note that some fake antivirus programs and ransomware infections are capable of infecting other user accounts on a system, so this method may not always work.

Sunday 31 August 2014

Process sniper - batch file



 
This is a small program I have been working on.  I have been working on it for a few hours in total so it still might have some bugs, but anyway.
The batch file contains two functions, 1.) it will list all the processes that are running on your computer and 2.) it can kill the process that you type in by either name (process.process extension e.g notepad.exe) or PID.  It also outputs all the process names you type in to an external file that is written over when you start the batch file again, the name of this file is configurable in the code under the variables at the top of the code.  It could easily save it anywhere on your hard drive with only very minor tweaks to the code.
here is the code:
 
 
@ECHO OFF
set version=1.6
set outputfile=log
set outfileext=txt
color 0a
title Process Sniper v%version%
echo Processes attempted to shut down in the last session:>%outputfile%.%outfileext%
echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo ::    Process Sniper v%version%        ::
echo ::          writen by John Allen        ::
echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo.
goto choice
exit /b
:list
wmic process get Name, ProcessID
goto choice
:kill
set /p input=Enter the process name/PID you wish to snipe:
taskkill /pid %input%
echo %input%>>%outputfile%.txt
goto choice
:close
cls
color 0c
echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo ::    You have been using        ::
echo ::    Process Sniper v%version%        ::
echo ::           writen by John Allen        ::
echo ::         Press any key to close...        ::
echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
pause>null
DEL null
exit
:choice
echo Choose from the following:
echo 1.) List processes currently running
echo 2.) Snipe a process by name/PID
echo 3.) Exit Process Sniper v%version%
choice /c 123 /n
if errorlevel 1 set gt=list
if errorlevel 2 set gt=kill
if errorlevel 3 set gt=close:
goto %gt%
 
 

How to Install localhost Server in Windows


How to Install localhost Server in Windows How to Install localhost Server in Windows

How to Install localhost Server in Windows

Steps to Install localhost Server in Windows :-

  1. First, go to Control Panel, and then click on Programs.
    Control Panel and then click on Programs How to Install localhost Server in Windows

    How to Install localhost Server in Windows
  2. Next click on Turn Windows features on and off.
    Turn Windows features on and off How to Install localhost Server in Windows
    How to Install localhost Server in Windows
  3. Now scroll down until you see Internet Information Services in the list. Click in the empty checkbox next to the title. It should turn into a small black square mark.
    Internet Information Services How to Install localhost Server in Windows

    How to Install localhost Server in Windows
  4. Once it has finished, you should be able to load the default website by going to your Internet Explorer and tying in localhost/. This should bring up the IIS 8 default web page.
    localhost How to Install localhost Server in Windows

    .How to Install localhost Server in Windows
  5. Now you can then go to Control Panel and click on Administrative Tools.
    Administrative Tools How to Install localhost Server in Windows
    How to Install localhost Server in Windows
  6. Now Open Internet Information Services (IIS) Manger.
    Internet Information Services IIS Manger How to Install localhost Server in Windows

    How to Install localhost Server in Windows
  7. To start, you only have the Default Web Site, which is stored under C:inetpubwwwroot.
  8. To setup a new website in IIS 8, right-click on Sites and choose Add Website.
    Add Website How to Install localhost Server in Windows

    How to Install localhost Server in Windows
  9. Give your site name e.g. (helpertricks) and browse to the physical path e.g. (C:inetpubwwwroottest) where the web files are stored.
    Add Website helpertricks How to Install localhost Server in Windows

    How to Install localhost Server in Windows
  10. Make your own html file that run on localhost for e.g. index.html file.
    index How to Install localhost Server in Windows

    How to Install localhost Server in Windows
  11. Now enter localhost/ as a URL and Hit Enter.
    localhost result How to Install localhost Server in Windows

    How to Install localhost Server in Windows
In these ways you are sucessfully install localhost server in windows, If you face any problem regarding this “How to Install localhost Server in Windows” post, feel free to comment below. Don’t forget to share with your friends.