Showing posts with label DOS. Show all posts
Showing posts with label DOS. Show all posts

Tuesday, February 21, 2012

How to change attributes of all folders/directory/files in dos

Few days ago, I connected my Flash Drive/ Pen Drive to my friend’s PC. My Pen Drive was infected by  virus.
This is a simple worm. It just make all your directory as system director and also make it hidden.(if you are using Microsoft windows as operating system).
So, I just First I deleted all those exe files and deleted recycled directory as well. This should remove your virus. But still you need remove the effect of virus. You need to update back the folder attributes.
You can do it by single line command:
[your drive letter]:/>attrib –s –h –r /s /d

F:/>attrib -s -h /s /d

Saturday, November 20, 2010

CHECK IF YOU ARE INFECTED BY DOS

When you first turn on you computer (BEFORE DIALING INTO YOUR ISP),
open a MS-DOS Prompt window (start/programs MS-DOS Prompt).
Then type netstat -arn and press the Enter key.
Your screen should display the following (without the dotted lines
which I added for clarification).

-----------------------------------------------------------------------------
Active Routes:

  Network Address          Netmask  Gateway Address        Interface  Metric
              127.0.0.0              255.0.0.0              127.0.0.1      127.0.0.1      1
  255.255.255.255  255.255.255.255  255.255.255.255          0.0.0.0      1

Route Table

Active Connections

  Proto  Local Address          Foreign Address        State

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

If you see anything else, there might be a problem (more on that later).
Now dial into your ISP, once you are connected;
go back to the MS-DOS Prompt and run the same command as before
netstat -arn, this time it will look similar to the following (without
dotted lines).

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

Active Routes:

  Network Address          Netmask  Gateway Address        Interface  Metric
          0.0.0.0          0.0.0.0    216.1.104.70    216.1.104.70      1
        127.0.0.0        255.0.0.0        127.0.0.1        127.0.0.1      1
      216.1.104.0    255.255.255.0    216.1.104.70    216.1.104.70      1
    216.1.104.70  255.255.255.255        127.0.0.1        127.0.0.1      1
    216.1.104.255  255.255.255.255    216.1.104.70    216.1.104.70      1
        224.0.0.0        224.0.0.0    216.1.104.70    216.1.104.70      1
  255.255.255.255  255.255.255.255    216.1.104.70    216.1.104.70      1

Route Table

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    0.0.0.0:0              0.0.0.0:0              LISTENING
  TCP    216.1.104.70:137      0.0.0.0:0              LISTENING
  TCP    216.1.104.70:138      0.0.0.0:0              LISTENING
  TCP    216.1.104.70:139      0.0.0.0:0              LISTENING
  UDP    216.1.104.70:137      *:*      

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

What you are seeing in the first section (Active Routes) under the heading of
Network Address are some additional lines. The only ones that should be there
are ones belonging to your ISP (more on that later). In the second section
(Route Table) under Local Address you are seeing the IP address that your ISP
assigned you (in this example 216.1.104.70).

The numbers are divided into four dot notations, the first three should be
the same for both sets, while in this case the .70 is the unique number
assigned for THIS session. Next time you dial in that number will more than
likely be different.

To make sure that the first three notation are as they should be, we will run
one more command from the MS-DOS window.
From the MS-DOS Prompt type tracert /www.yourispwebsite.com or .net
or whatever it ends in. Following is an example of the output you should see.

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

Tracing route to /www.motion.net [207.239.117.112]over a maximum of 30 hops:
1  128 ms  2084 ms  102 ms  chat-port.motion.net [216.1.104.4]
2  115 ms  188 ms  117 ms  chat-core.motion.net [216.1.104.1]
3  108 ms  116 ms  119 ms  www.motion.net [207.239.117.112]
Trace complete.

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

You will see that on lines with the 1 and 2 the first three notations of the
address match with what we saw above, which is a good thing. If it does not,
then some further investigation is needed.

If everything matches like above, you can almost breath easier. Another thing
which should you should check is programs launched during startup. To find
these, Click start/programs/startup, look at what shows up. You should be
able to recognize everything there, if not, once again more investigation is
needed.

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

Now just because everything reported out like we expected (and demonstrated
above) we still are not out of the woods. How is this so, you ask? Do you use
Netmeeting? Do you get on IRC (Internet Relay Chat)? Or any other program
that makes use of the Internet. Have you every recieved an email with an
attachment that ended in .exe? The list goes on and on, basically anything
that you run could have become infected with a trojan. What this means, is
the program appears to do what you expect, but also does just a little more.
This little more could be blasting ebay.com or one of the other sites that
CNNlive was talking about.

What can you do? Well some anti-virus software will detect some trojans.
Another (tedious) thing is to start each of these "extra" Internet programs
one at a time and go through the last two steps above, looking at the routes
and connection the program uses. However, the tricky part will be figuring
out where to tracert to in order to find out if the addresses you see in
step 2 are "safe" or not. I should forewarn you, that running tracert after
tracert, after tracert might be considered "improper" by your ISP. The steps
outlined above may not work exactly as I have stated depending upon your ISP,
but with a true ISP it should work. Finally, this advise comes with NO
warranty and by following my "hints' you implicitly release me from ANY and
ALL liability which you may incur.

Other options

Display protocol statistics and current TCP/IP network connections.
Netstat [-a] [-e] [-n] [-s] [-p proto] [-r] [intervals]

-a.. Display all connections and listening ports.
-e.. Display Ethernet statistics. This may be combined with the -s option.
-n.. Diplays address and port numbers in the 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, of IP.
-r.. Display the routing table.
-s.. Display 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..Redisplay selected statistics, pausing intervals seconds between each
display. If omitted. netstat will print the current configuration information
once

Monday, June 28, 2010

HOW TO INSTALL XP FROM DOS

Install Xp From Dos

If XP will not install from the CD or if you have a new drive with no operating system on
it yet try these:

Install Windows XP from the hard drive with Windows 98 already installed:

Boot Windows 98
Insert the XP CD into your CD reader
Explore Windows XP through My Computer
Copy i386 folder to C:\
Go into C:\i386 folder and double click on winnt32.exe to launch the setup from the hard drive

Install Windows XP from DOS (ie. no OS on a new hard drive):

Boot with a Windows 98 Start Up disk
Insert the Windows 98 CD into the CD reader
Run smartdrv.exe from the Win98 directory on the windows 98 CD (file caching)
Type cd.. to back up to the root directory
Insert Windows XP CD into the CD reader
Copy the i386 folder to C:\
Go into C:\i386 folder on C: and type winnt.exe to launch the setup from the hard drive.

Wednesday, December 16, 2009

USEFULL DOS COMMANDS

-->

Dos Commands



ATTRIB , - The comma does the same thing as ATTRIB -a -h -r - s *.* (removes all attribs).
BACKUP /HP - Unknown
DIR , - This list's all file's including hidden files, does not work in Windows 95
DIR ... - lists all directories that do not have extensions.
DOSKEY /APPEDIT - Unknown
DOSKEY /COMMAND - Unknown
DOSKEY /PERMANENT - Unknown
DOSKEY /SCRSIZE - Unknown
DOSKEY /XHISTORY - Unknown
FDISK /MBR - Recreates the master boot record good way to get rid of Virus's
FDISK /PRI - See FDISK Page for additional information.
FDISK /EXT - See FDISK Page for additional information.
FDISK /LOG - See FDISK Page for additional information.
FDISK /Q - Prevents fdisk from booting the system automatically after exiting fdisk.
FDISK /STATUS - Shows you the current status of your hard drives.
FORMAT /AUTOTEST - Formats the hard drive without any prompting.
FORMAT /BACKUP - Like /AUTOTEST but it will ask you for a volume label.
FORMAT /Z:n - Command used with FDISK supporting FAT32, used to specify the cluster size in bytes where n is multiplied by 512.
MEM /A or /ALL - Adds a line into the MEM command tells the available space in HMA.
 SET DIRCMD=0 -Will make all directories hidden however still accessable, to get them back SET DIRCMD=
 TRUENAME - Put before a file well display the whole directory which it exists.
TRACERT - When you are online tells the address that you are at such as www.yahoo.com, only in Windows 95
VER /R - Tells you the Revision and if DOS is in HMA.

Monday, October 12, 2009

CHAT WITH COMMAND PROMPT

If you want personal chat with a friend
you don't need to download any yahoo messenger
All you need is your friends IP address and Command Prompt.
Firstly, open Notepad and enter:
@echo off
:A
Cls
echo MESSENGER
set /p n=User:
set /p m=Message:
net send %n% %m%
Pause
Goto A

Now save this as "Messenger.bat". Open the .bat file and in Command
Prompt you should see:
MESSENGER
User:
After "User" type the IP address of the computer you want to contact.
After this, you should see this:
Message:
Now type in the message you wish to send.Before you press "Enter" it should look like this:
MESSENGER

User:27.196.391.193
Message: Hi
Now all you need to do is press "Enter", and start chatting!

Wednesday, August 26, 2009

BATCH SCRIPT FOR UXTHEME.DLL

Here is a batch script to help out with replacing uxtheme.dll:

Copy and paste the text below into notepad and save the file as rename.bat. Then just execute the batch script to reanme the easily.

ren $dlldir$uxtheme.dll $dlldir$uxtheme.dll.bak

ren $dlldir$uxtheme.pat $dlldir$uxtheme.dll


Fluid Tumblr ThemeImage by Andrew Wilkinson via Flickr




Reblog this post [with Zemanta]

Monday, July 13, 2009

How can I loop or start a batch file over after it has completed?

Using the goto command within a batch easily allows a user to loop or restart a batch file after it has been completed. Below are some examples of how this command can be used. This page was created with the easiest, but not necessarily recommended solution first, to the most difficult solution but recommended method last.

@echo off
cls
:start
echo This is a loop
goto start

In this first example, the computer will print "This is a loop" over and over until you terminate the file. To cancel this example press: CTRL + C.

@echo off
cls
:start
echo This is a loop
pause
goto start

Next, adding the pause statement before the goto line will prompt the user to press any key before looping the batch file. This is helpful and recommended to help prevent the computer from utilizing all or most of its resources in having to continuously rerun the loop and will allow the user to rerun the batch when they're ready.

@echo off
cls
:start
echo This is a loop
set choice=
set /p choice="Do you wish to restart? Press 'y' and enter for Yes: "
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='y' goto start

Finally, in this last example and most recommend method, the user would be prompted if they wish to rerun the batch file. Pressing "y" would use the goto command and go back to start and rerun the batch file. Pressing any other key would exit the batch file. This example is for Windows 2000, XP and later users if you're running earlier Windows 98 or earlier you'd need to use the choice command.

BAT FILE COMMANDS

   ADDUSERS Add or list users to/from a CSV file
ARP Address Resolution Protocol
ASSOC Change file extension associations•
ASSOCIAT One step file association
AT Schedule a command to run at a later time
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 Clear the 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 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 protocols
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 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 Create or Edit Scheduled Tasks
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•

Deleting files in MS-DOS without a prompt.

Deleting files in MS-DOS without a prompt.

Cause:

To help prevent files from becoming accidentally deleted Microsoft will warn you before deleting files or folders.

Solution:

By default Microsoft Windows will not prompt a user or give a user a prompt or warning when deleting files on a computer using the del command. However, when attempting to delete a directory using the deltree or rmdir command on a directory that is not empty you will receive a warning and/or error message about deleting the directory.

To suppress the prompting use the deltree command and add the tag /y. Here is an example of how the whole command would look, deltree c:\windows\temp\*.* /y However, this does not work in all versions of Windows and or DOS.

If this command does not work we would recommend that you create a batch file with the below command in the batch file.

echo y | del %1\*.*

Once created, you can type the name of the batch file then the name of the directory that you wish to delete.

Microsoft Windows 2000 and Windows XP users

Users who wish to delete a directory containing files in a MS-DOS session running under Microsoft Windows 2000 or Windows XP can also use the rmdir or rd command with the /S option.

Please remember that when you delete files or directories from the computer they are permanently removed, so be careful! Microsoft Windows 95, Windows 98, Windows ME, Windows NT, Windows 2000, Windows XP, and later versions of Windows users deleting files through MS-DOS should realize that all deleted files will not be sent to the recycle bin.

Other users using MS-DOS through Windows

Users running MS-DOS through later versions of Microsoft Windows can also utilize the erase command to delete files without a prompt. Microsoft Windows 95, Windows 98, Windows ME, Windows NT, Windows 2000, Windows XP, and later versions of Windows users deleting files through MS-DOS should realize that all deleted files will not be sent to the recycle bin.

Creating a batch file

Creating a batch file

MS-DOS users
Microsoft Windows and other users

MS-DOS users

To create a basic batch file in MS-DOS, follow the below steps that give you an example of how to create a basic batch file.

  1. Open an MS-DOS command window or get to MS-DOS. Additional information about doing this can be found on document CHDOS.
  2. At the MS-DOS prompt, type: edit test.bat and press enter.
  3. If typed properly, you should now be in a blue screen. Within the screen, type:

    pause
    dir c:\windows
    dir c:\windows\system

  4. Once the above three lines have been typed in, click File and choose exit; when prompted to save, click "Yes." Users who do not have a mouse cursor can accomplish this same task by pressing ALT+F to access the file menu, then pressing "X" to exit, and pressing enter to save changes.
  5. Once you are back at the MS-DOS prompt, type: test and press enter. This will execute the test.bat file and begin running the file. Because the first line is pause, you will first be prompted to press a key. Once you press a key the batch file will run line-by-line; in this case, listing the files in the windows and windows\system directories.

If you wish to add more lines to this batch file you would simply type "edit test.bat" to edit the file again.

Additional information about the MS-DOS edit command can be found on our edit command page. Some versions of MS-DOS and bootable diskettes may not have the edit command; if this is the case, you would either need to obtain the edit.com file to access this file or use the copy con command.

Microsoft Windows and other users

A Windows user can still use the above MS-DOS steps if they wish to create a batch file. If, however, you're more comfortable using Microsoft Windows or your operating system, you can use any text editor, such as Notepad or Wordpad, to create your batch files, as long as the file extension ends with .bat. In the below example we use the Windows notepad to create a batch file.

  1. Click Start
  2. Click Run
  3. Type: notepad and press enter.
  4. Once notepad is open, type the below lines in the file or copy and paste the below lines into notepad.

    @echo off
    echo Hello this is a test batch file
    pause
    dir c:\windows

  5. Click File and click Save; browse to where you want to save the file. For the file name, type "test.bat", and if your version of Windows has a "Save as type" option, choose "All files", otherwise it will save as a text file. Once all of this has been done click the Save button and exit notepad.
  6. Now, to run the batch file, simply double-click or run the file like any other program. Once the batch file has completed running it will close the window automatically.

WHAT IS Batch file

WHAT IS Batch file

Batch files allow MS-DOS and Microsoft Windows users to create a lists of commands to run in sequence once the batch file has been executed. For example, a batch file could be used to run frequently run commands, deleting a series of files, moving files, etc. A simple batch file does not require any special programming skills and can be done by users who have a basic understanding of MS-DOS commands.

A good example of a batch file for someone who is more familiar with Windows or the MacOS is to think of a batch file as a shortcut in Windows or an icon on the MacOS. Much like a shortcut, batch files could be used to run one or more commands and/or programs through the command line.

Another example of a very well known batch file is the autoexec.bat, which is a simple boot file loaded each time the computer is loaded on MS-DOS and early Windows computers. This batch file contained all the necessary commands and programs used to run MS-DOS and Windows each time the computer booted.