Sign in with
Sign up | Sign in
Your question

CMD command

Last response: in Windows XP
Share
Anonymous
July 29, 2005 6:16:55 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

hello,

i use to use <pre xp> cmd.exe to print a list of files in a folder.
i thought this was the syntax that i was using, but it doesn't print
anything.
cmd.exe /c dir "%1" >PRN

i've looked in the help and support center, but couldn't find any examples
to show me what i'm doing wrong.
i was able to add this to the registry, which would add a menu item, so when
i clicked on a folder in windows explorer and right clicked and selected the
option, a list would print of all the files in the folder that i selected.

any help would be greatly appreciated.
thank you.
--
Indera
* * * * * * * * * *
Don't just live life.
Live life well.

More about : cmd command

July 29, 2005 6:16:56 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

The book "Microsoft Windows Command Line" ISBN 0-7356-2038-5 has all the
info you need on running things under XP.

"Dr. Indera" <dr.indera.bugoff@cant.spam.me> wrote in message
news:eiMU0mGlFHA.2860@TK2MSFTNGP15.phx.gbl...
> hello,
>
> i use to use <pre xp> cmd.exe to print a list of files in a folder.
> i thought this was the syntax that i was using, but it doesn't print
> anything.
> cmd.exe /c dir "%1" >PRN
>
> i've looked in the help and support center, but couldn't find any examples
> to show me what i'm doing wrong.
> i was able to add this to the registry, which would add a menu item, so
> when
> i clicked on a folder in windows explorer and right clicked and selected
> the
> option, a list would print of all the files in the folder that i selected.
>
> any help would be greatly appreciated.
> thank you.
> --
> Indera
> * * * * * * * * * *
> Don't just live life.
> Live life well.
>
>
>
Anonymous
July 29, 2005 7:26:42 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

See...
Print
http://www.microsoft.com/resources/documentation/window...

-----

Also...

[[To print a directory listing, type:

dir > prn

When you specify prn, the directory list is sent to the printer attached to
the LPT1 port. If your printer is attached to a different port, you must
replace prn with the name of the correct port.

You can also redirect output of the dir command to a file by replacing prn
with a file name. You can also type a path. For example, to direct dir
output to the file Dir.doc in the Records directory, type:

dir > \records\dir.doc

If Dir.doc does not exist, dir creates it, unless the Records directory does
not exist. In that case, the following message appears:

File creation error

To display a list of all the file names with the .txt extension in all
directories on drive C, type:

dir c:\*.txt /w/o/s/p

Dir displays, in wide format, an alphabetized list of the matching file
names in each directory and pauses each time the screen fills up, until you
press a key to continue. ]]
From...
Dir
http://www.microsoft.com/resources/documentation/window...

-----

PRN
[[HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices

Data type Range Default value
REG_SZ Device name \DosDevices\LPT1

Description
Associates the PRN device name that applications use with the system's
internal name for the printer port.]]
http://www.microsoft.com/resources/documentation/Window...


--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In news:eiMU0mGlFHA.2860@TK2MSFTNGP15.phx.gbl,
Dr. Indera <dr.indera.bugoff@cant.spam.me> hunted and pecked:
> hello,
>
> i use to use <pre xp> cmd.exe to print a list of files in a folder.
> i thought this was the syntax that i was using, but it doesn't print
> anything.
> cmd.exe /c dir "%1" >PRN
>
> i've looked in the help and support center, but couldn't find any examples
> to show me what i'm doing wrong.
> i was able to add this to the registry, which would add a menu item, so
> when i clicked on a folder in windows explorer and right clicked and
> selected the option, a list would print of all the files in the folder
> that i selected.
>
> any help would be greatly appreciated.
> thank you.
> --
> Indera
> * * * * * * * * * *
> Don't just live life.
> Live life well.
Related resources
July 30, 2005 5:56:57 AM

Archived from groups: microsoft.public.windowsxp.general (More info?)

Dr. Indera wrote on Fri, 29 Jul 2005:

>hello,
>
>i use to use <pre xp> cmd.exe to print a list of files in a folder.
>i thought this was the syntax that i was using, but it doesn't print
>anything.
>cmd.exe /c dir "%1" >PRN
>
>i've looked in the help and support center, but couldn't find any examples
>to show me what i'm doing wrong.
>i was able to add this to the registry, which would add a menu item, so when
>i clicked on a folder in windows explorer and right clicked and selected the
>option, a list would print of all the files in the folder that i selected.
>
>any help would be greatly appreciated.
>thank you.


Hi Indera

Your command works fine in a batch file. The problem you're having is
because of that "%1", which is a placeholder standing in for a folder
name.

If you're trying to type this in the Run box or at a Command prompt, it
won't work; to do that, you need to give the name of the folder whose
files you want listed instead of "%1", like this:

cmd /c dir C:\icons >prn

If you're going to use it a lot, it would be more convenient to save
your command in Notepad as a .BAT file, say Filelist.bat, in a folder on
your path. Then you supply the name of the listing folder by typing it
after the name of the batch file, for example:

filelist C:\icons

When the batch file runs it will substitute "C:\icons" for "%1".

Hope this helps.

--
Nightowl
Anonymous
August 4, 2005 9:14:04 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

hi jerry,

thank you for the reference book. did you write it?

--
Indera
* * * * * * * * * *
Don't just live life.
Live life well.


"Jerry" <NoSpamChiefZeke@MSN.com> wrote in message
news:enckRKIlFHA.1444@TK2MSFTNGP10.phx.gbl...
: The book "Microsoft Windows Command Line" ISBN 0-7356-2038-5 has all the
: info you need on running things under XP.
:
: "Dr. Indera" <dr.indera.bugoff@cant.spam.me> wrote in message
: news:eiMU0mGlFHA.2860@TK2MSFTNGP15.phx.gbl...
: > hello,
: >
: > i use to use <pre xp> cmd.exe to print a list of files in a folder.
: > i thought this was the syntax that i was using, but it doesn't print
: > anything.
: > cmd.exe /c dir "%1" >PRN
: >
: > i've looked in the help and support center, but couldn't find any
examples
: > to show me what i'm doing wrong.
: > i was able to add this to the registry, which would add a menu item, so
: > when
: > i clicked on a folder in windows explorer and right clicked and selected
: > the
: > option, a list would print of all the files in the folder that i
selected.
: >
: > any help would be greatly appreciated.
: > thank you.
: > --
: > Indera
: > * * * * * * * * * *
: > Don't just live life.
: > Live life well.
: >
: >
: >
:
:
Anonymous
August 4, 2005 9:14:07 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

thank you wesley.
i will read the info on the link you gave me.

--
Indera
* * * * * * * * * *
Don't just live life.
Live life well.


"Wesley Vogel" <123WVogel955@comcast.net> wrote in message
news:%23M0RpQIlFHA.3148@TK2MSFTNGP09.phx.gbl...
: See...
: Print
:
http://www.microsoft.com/resources/documentation/window...
:
: -----
:
: Also...
:
: [[To print a directory listing, type:
:
: dir > prn
:
: When you specify prn, the directory list is sent to the printer attached
to
: the LPT1 port. If your printer is attached to a different port, you must
: replace prn with the name of the correct port.
:
: You can also redirect output of the dir command to a file by replacing prn
: with a file name. You can also type a path. For example, to direct dir
: output to the file Dir.doc in the Records directory, type:
:
: dir > \records\dir.doc
:
: If Dir.doc does not exist, dir creates it, unless the Records directory
does
: not exist. In that case, the following message appears:
:
: File creation error
:
: To display a list of all the file names with the .txt extension in all
: directories on drive C, type:
:
: dir c:\*.txt /w/o/s/p
:
: Dir displays, in wide format, an alphabetized list of the matching file
: names in each directory and pauses each time the screen fills up, until
you
: press a key to continue. ]]
: From...
: Dir
:
http://www.microsoft.com/resources/documentation/window...
:
: -----
:
: PRN
: [[HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices
:
: Data type Range Default value
: REG_SZ Device name \DosDevices\LPT1
:
: Description
: Associates the PRN device name that applications use with the system's
: internal name for the printer port.]]
:
http://www.microsoft.com/resources/documentation/Window...
:
:
: --
: Hope this helps. Let us know.
:
: Wes
: MS-MVP Windows Shell/User
:
: In news:eiMU0mGlFHA.2860@TK2MSFTNGP15.phx.gbl,
: Dr. Indera <dr.indera.bugoff@cant.spam.me> hunted and pecked:
: > hello,
: >
: > i use to use <pre xp> cmd.exe to print a list of files in a folder.
: > i thought this was the syntax that i was using, but it doesn't print
: > anything.
: > cmd.exe /c dir "%1" >PRN
: >
: > i've looked in the help and support center, but couldn't find any
examples
: > to show me what i'm doing wrong.
: > i was able to add this to the registry, which would add a menu item, so
: > when i clicked on a folder in windows explorer and right clicked and
: > selected the option, a list would print of all the files in the folder
: > that i selected.
: >
: > any help would be greatly appreciated.
: > thank you.
: > --
: > Indera
: > * * * * * * * * * *
: > Don't just live life.
: > Live life well.
:
Anonymous
August 4, 2005 9:14:16 PM

Archived from groups: microsoft.public.windowsxp.general (More info?)

ahhhh,
that explains why it isn't working.
i am getting things all mixed up.
thank you nightowl.
--
Indera
* * * * * * * * * *
Don't just live life.
Live life well.


"Nightowl" <owl@[127.0.0.1]> wrote in message
news:NUx6WrNZBt6CFwTT@black.hole...
: Dr. Indera wrote on Fri, 29 Jul 2005:
:
: >hello,
: >
: >i use to use <pre xp> cmd.exe to print a list of files in a folder.
: >i thought this was the syntax that i was using, but it doesn't print
: >anything.
: >cmd.exe /c dir "%1" >PRN
: >
: >i've looked in the help and support center, but couldn't find any
examples
: >to show me what i'm doing wrong.
: >i was able to add this to the registry, which would add a menu item, so
when
: >i clicked on a folder in windows explorer and right clicked and selected
the
: >option, a list would print of all the files in the folder that i
selected.
: >
: >any help would be greatly appreciated.
: >thank you.
:
:
: Hi Indera
:
: Your command works fine in a batch file. The problem you're having is
: because of that "%1", which is a placeholder standing in for a folder
: name.
:
: If you're trying to type this in the Run box or at a Command prompt, it
: won't work; to do that, you need to give the name of the folder whose
: files you want listed instead of "%1", like this:
:
: cmd /c dir C:\icons >prn
:
: If you're going to use it a lot, it would be more convenient to save
: your command in Notepad as a .BAT file, say Filelist.bat, in a folder on
: your path. Then you supply the name of the listing folder by typing it
: after the name of the batch file, for example:
:
: filelist C:\icons
:
: When the batch file runs it will substitute "C:\icons" for "%1".
:
: Hope this helps.
:
: --
: Nightowl
!