Dos Tutor for everyone
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Other forums
- :
- Tech Help - Software/Hardware etc
- :
- Re: Dos Tutor for everyone
Dos Tutor for everyone
02-11-2008 11:56 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I thought a would do one tutor and if people find it interesting and ask for more then I can do some more.
Lets start by getting to DOS in XP or Vista there are to commands which differ slightly. First goto the start and then choose run and in the box type cmd and press return you will then get a box up with something like this, the mwright will be your username you have logged in with
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\mwright>
Its telling us its XP and you are in a folder or directory called Documents and Settings which is on drive c: and we are actually in a sub directory or folder called mwright. C:\ is the root of a windows system and all directories come from that. Think of it as a room you don’t throw all your letters on the floor you put them in a draw or directory or folder in this case its called Documents and Settings then to keep your files separate you put another box inside that one called mwright.
The second way to get a DOS prompt is to goto start run then type command and you then get a window like this.
Microsoft(R) Windows DOS
(C)Copyright Microsoft Corp 1990-2001.
C:\DOCUME~1\MWRIGHT>
You will notice in this case the Documents and Settings has now become DOCUME~1 this is because DOS could only have 8 characters as a name so it now displays the first 6 and the rest is represented by ~1 the directory is actually the same. To save confusion we will only use the cmd window or the article will be to long all you need to know is if you use the command then you have to use only the first 6 characters of directories. So back to our cmd window.
We want to look at 2 commands the cd and dir.
CD is short for change directory and DIR is short for directory. Lets start with cd in the cmd window type
Cd\ and press return the display should change to c:\ so we have changed the currant directory from Documents and Settings\mwright> to c:\.
Lets go back to were we came from by typing
C:\>cd\Documents and Settings\mwright replace the mwright with your name. you should now be back were you started.
How would we get to c:\windows?
Cd\windows the prompt gives you the current directory so you know were you are.
Lets go back to c:\ by typing c:\
Now for the second command DIR try it type dir and press return
What you will see is a list of files and some that say <DIR> the DIR are directories not files you will recognize windows, program files and some others you often use with explorer.
DIR list the files and directories and has what are called switches that is you can tell it how to display the file by adding / followed by a switch.
There are a fair few but try typing
Dir /w and dir/p
The first one dir/w will display the files in a wide format and the /p will show one screen at a time and then you have to press a key to see more. DIR is a very useful tool and often faster than the GUI it can be used for as a search tool. DIR on its own displays all files but you can add switches to show just the files you want. So dir fred.txt will only show files called fred.txt.
Dir autoexec.bat will only display the files called autoexec.bat. Now the clever bit is if you are not sure of something you can say look for all the files ending in txt by using * as this represents anything. So dir *.txt will display all the .txt files. Dir text.* will show any file called text no matter what the extension is . dir *.* will show all files.
For those that don’t know a file has a name a . and an extension the name after the .
The extension tells you what the file type is so a .txt is a text file a .exe is a program file which will run a programme a .doc is generally a word document. There are all sorts of extensions and you can make your own up if you want. Windows uses the extension to work out how it will open the file so If you click on a file with .txt windows will normally open it with notepad.
For our final trick lets use what we have learnt to do something useful make sure you are in c:\
Now we will use another dir switch /s type
Dir *.jpg /s and watch as the screen flashes bye the /s tell it to display all files in subdirectories so what we have done is a full file search on drive c: for all pictures with a jpg extension but note how fast its displayed them.
So to see all txt files we do dir *.txt /s
One final trick the screen flashed by with loads of files to make matters simpler we can pipe the answer to a file by doing >filename
So if we now do the same again but type
Dir *.jpg /s >pics.txt
You will then under up with a file in c:\ called pics.txt with a list of all your jpg files you can open this with word or notepad. If you did the command again it would overwrite the files but if you added another > it would add the files to the list so the command would be
Dir *.jpg /s >>pics.txt
I hope you have found this little article useful let me know if you want more you have learnt
DIR
Cd\
How to open a dos or cmd window and use it to change directories
Re: Dos Tutor for everyone
03-11-2008 12:11 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Likewise I started even before DOS - but not professionally in IT.
Also used DRDOS ( Digital Research )
found batch commands very useful
One thing I would like to know is how to convert from and to Windows long file names to the shortened DOS ones - if you could please.
Re: Dos Tutor for everyone
03-11-2008 1:26 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Still good to keep up with the command line skills
I think I discovered this by accident, but I figured out rather than having to type:
Quote cd c:\a very long directory name with many spaces like program files
You can type:
Quote cd c:\a very long*
Then it'll match the closest directory name.
Could be a Windows feature, as it works in XP and above in a Command Prompt. Not sure about a vanilla DOS.
Re: Dos Tutor for everyone
03-11-2008 8:04 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I started to learn dos commands when I bought my first computer, the Amstrad 640 portable, which I still have! together with a rather thick manual containing all the dos commands.
But I soon graduated to more modern (at the time!) computers and that is where my knowledge of dos ended.
I have needed to understand dos recently when I have experienced crashes and wanted to use a backup disk but unfortunately when I got the dos command coming up, that is when I bowed out
I only got a C prompt and didn't know what to do with it in order to get the pc up and running AND STILL DON'T...............
cheers
Re: Dos Tutor for everyone
03-11-2008 8:08 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: mal0z
Also used DRDOS ( Digital Research )
Your mention of DRDOS reminds me that , if I am correct, these are the people who were just pipped at the post by Bill Gates and his party.
I seem to remember that Gates was determined to get HIS o/s on the market before Digital Research and launched it together with all the bugs it still contained...hence the continuing problems we have with Microsoft..........
Re: Dos Tutor for everyone
03-11-2008 9:06 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I have approx 30 to manipuilate, the csv is easy C:\ren *.asc *.csv The second Is currently stumping me C:\ren pocketgps_uk_p*.* p*.* doesnt work. what should I be using
Also on my XP in the Program list I have Accesories\comand prompt which bring up a "Dos" window. and dont forget the last command is exit to get back to M$S
Re: Dos Tutor for everyone
03-11-2008 9:42 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Dos Tutor for everyone
03-11-2008 9:48 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
When in dos dont forget that to access a file name with included spaces you have to include the file name within parenthesis
i.e. "a long File Name"
Re: Dos Tutor for everyone
03-11-2008 10:41 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
To argue with someone who has renounced the use of reason is like administering medicine to the dead - Thomas Paine
Re: Dos Tutor for everyone
03-11-2008 11:21 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Dos Tutor for everyone
03-11-2008 1:05 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
To argue with someone who has renounced the use of reason is like administering medicine to the dead - Thomas Paine
Re: Dos Tutor for everyone
03-12-2008 8:03 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
To complete long directory names when using cd try typing the 1st couple of letters of the directory name and then press TAB ..that completes the line too..press TAB again for the next directory alphabetically.
To prevent getting a dos 8.3 shortened directory structure use CMD rather than COMMAND, its the XP and Vista version of the command prompt (and NT and W2K for that matter)
TTFN
Re: Dos Tutor for everyone
04-12-2008 5:12 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Dos Tutor for everyone
08-12-2008 11:24 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
pocket~1.asc
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Other forums
- :
- Tech Help - Software/Hardware etc
- :
- Re: Dos Tutor for everyone