Results 1 to 2 of 2

Thread: Power User's DOS 2

  1. #1
    Join Date
    Dec 2002

    Post Power User's DOS 2

    [blur]#!/usr/ bin/env python[/blur]

    Greeting all AO heads!

    This is the second of my 1st tutorial. Thanx for the positive feed on it, hope this one quenches your thirst. Let's start by checking out a few more commands.

    (type these command with /? switch to view it's options)

    cd - changes directories
    cls - clear screen
    copy - u know
    defrag - optimizes a disk
    del - delete files
    dir - shows files in directory
    diskcopy - copies a diskette
    edit - Dos editor
    format - prepares a disk for use
    md - make a directory
    mem- shows avaiable memory
    move - move files to a specify location
    prompt - customizes the Dos prompt(very qewl cli look)
    rd - removes a directory
    ren - renames a file
    Scandisk - locates and repairs disk problems
    type - displays contents of a file

    These are some undocumented ones as well
    fc - compares 2 files or set of files and displays the difference between them
    fdisk/mbr - shows the Master Boot Record contents
    attrib/s (filename) - use in batch script to search for a file it's faster than using find

    These are tcp/ip commands check them out:
    arp -shows IP to Physical address translation table used by address resolution protocol(arp)
    nslookup - is a cool tool for making Dns queries
    finger - gives U lots of user info
    ping - use to see if a site exists
    ftp - downloading and uploading files to and from a server
    rcp - copies files to and from computer running rcp services
    hostname - use this to set hostname of your computer
    rexec - runs commands on remote host running rexec services
    ipconfig - use to see your ip configurations computer
    route - manipulates network routing table
    rsh(remote termial session) -run commands on remote host running this service
    nbstat - shows netbios over tcp/ip
    tracert - trace the network route to any ip
    netstat - shows active ports on your computer (most will be closed)
    telnet - connect to a remote host

    Ok, I forgot one last command DEBUG in older versions of Dos it's called DEBUG.COM, but in newer versions of Dos it's DEBUG.EXE. A very useful tool and a Haxor's best friend. If U have guess by now debug is a utility program designed to help U locate and idenitiy bugs. A debugger allows you to execute the machine code in programs one at a time. Dos debug is limited compared to other debugging software, but perfectly good. What is it use for? Debug packs it's own bag of dirty tricks. Like showing or changing memory, files, contents of all computer registers, filling a region of memory with a single value, search memory for sequences of binary values, assemble new machine instructions into memory, unassemble binary code into their mnemonic & operand and single-step a program under test.

    Open edit or notepad type:
    is a
    cool dude

    Save as cool.txt then at cli type debug cool.txt now lets look at it's hex dump at the dash (-) type d. Slow down I know it may look wierd to you but the hex dump has 3parts. The left most is the address in memory, the middle is the hexadeciaml represention of the 128 bytes of memory being shown; 16 bytes in each row. To the right is those 128 bytes of memory being shown as ASCII characters. Not all binary values have printable ASCII chars.
    any unprintable characters are shown as . play with this tool some but be very very careful using not to mess up anything close it by hitting q at - prompt.

    Now lets explore batch files they always in a .bat extension
    they are simple and easy to write which can be done in notepad or edit. I prefer edit
    first some commands:
    @ -suppress display for that command
    con - either screen or keyboard
    prn - printer
    nul - Dos's version of a black hole
    rem - comment line
    echo - shows text to user
    echo off - take a guess (hehe!)
    pause - suspend a batch file
    set - store info to be use more than once
    goto - used to jump to any line to continue processing
    if - used to cause batch file to follow one of two paths true or false
    exist - command used to test the presence of a file or group of files
    not - used to reverse any decision(ex: if not or if not exist)
    for - used to construct a loop on one line
    :whatever -used to assign a name of label
    ctty - termial screen

    Batch files can be stop by hitting ^c or ^break but if you put a @ctty nul(at top of file) and ctty con(at bottom of file) in file it can't be stop until complete with ^c or ^break.
    what about a time delay in your scripts use these (type nul | choice/n /cy/ty, 5 > nul)
    where 5 is that's the number of seconds to delay
    to change a drive or director easily use: %1\
    useage: cdd c:/valid drive or cdd c:

    That's it I tried to add more advance commands but batch scripting I have done in a while. To me its lame and slow for my needs so I rarely use it. peace


  2. #2
    Senior Member
    Join Date
    Nov 2002
    Great work -!~
    \"I have a 386 Pentium.\"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts