Go Back   Cyber Tech Help Support Forums > Operating Systems > Older Windows Versions > Windows XP

Notices

Windows XP Problem solving for the Windows XP Operating System

Reply
 
Topic Tools
  #1  
Old March 26th, 2010, 01:55 AM
rocky6's Avatar
rocky6 rocky6 is offline
New Member
 
Join Date: Mar 2010
O/S: Windows XP Pro
Location: Australia
Posts: 8
Command promt question

Hello, first of all this is a home work question! and i have researched it but there seems to be alot of answers so I am confused even though it seems like a simple question!...

Q. In a command, what is the purpose of the redirection symbol? (>)

My A. It used to send the output from a command?

Is this correct?

Cheers
Reply With Quote
  #2  
Old March 26th, 2010, 03:17 AM
AnnMarie's Avatar
AnnMarie AnnMarie is offline
CTH Subscriber
 
Join Date: Oct 2001
O/S: Windows Vista 32-bit
Location: New Zealand
Posts: 59,810
Hi rocky6 and welcome. I dont usually help with homework questions however it does look like you have tried to research the question yourself so I will make an exception this time.

You are on the right track. That particular redirector will send the output of a command to a file that you specify. The file will be created if it doesnt exist or overwritten if it does. I use it a lot - see a simple example below:

dir /s /a "c:\normal.dot" > c:\find.txt

The above command searches the C drive and sub directories for all files named "normal.dot" and sends the output (result of the search) to a text file on the C drive named find.txt.
Reply With Quote
  #3  
Old March 26th, 2010, 05:10 AM
rocky6's Avatar
rocky6 rocky6 is offline
New Member
 
Join Date: Mar 2010
O/S: Windows XP Pro
Location: Australia
Posts: 8
Thank you so much AnnMarie. You have made it clear to me and yes alot of research I did do on this. So thank you again, I understand now
Reply With Quote
  #4  
Old March 26th, 2010, 12:29 PM
Jj4cL Jj4cL is offline
Senior Member
 
Join Date: Dec 2005
Posts: 360
Also, if I may, and even for my recall of dos commands, the letter "a" limits the search result to only files with the "a" attribute attached. Eliminating the "a" switch would theoretically expand the search to all files, even though the "a" is usually attached to most files. Is this an accurate statement?
Reply With Quote
  #5  
Old March 26th, 2010, 09:33 PM
AnnMarie's Avatar
AnnMarie AnnMarie is offline
CTH Subscriber
 
Join Date: Oct 2001
O/S: Windows Vista 32-bit
Location: New Zealand
Posts: 59,810
You are welcome rocky6.

Hi Jj4cL. Not quite. Using the /a switch alone displays all the files (including system and hidden) and sub directories (but not the files or folders within any sub directories) however it can be used to limit the search to files with certain attributes as you have suggested.

For example:
cd\ && dir /a:a > c:\find.txt

The above command will find every file in the root directory with the archive bit set ("a" attribute). The double ampersand is a special type of command separator and allows you to string multiple commands together on a single line.
Reply With Quote
Reply

Bookmarks

Topic Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Topic Topic Starter Forum Replies Last Post
System restore from the command promt Jimmy9369 Windows XP 3 October 13th, 2008 10:50 PM
Command Promt Exits When "Enter" Is Pressed Blueback00 Windows XP 0 July 8th, 2008 08:49 PM
Help with Command Promt kelly1897 Windows XP 9 August 10th, 2007 12:44 AM
Command Promt Error ccbling Malware Removal 3 March 28th, 2006 10:12 AM
My command promt wont work ninjaval Windows NT, 2000, 2003, 2008, 2012 2 April 8th, 2003 06:43 AM


All times are GMT +1. The time now is 10:29 AM.