CMD command

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.
6 answers Last reply
More about command
  1. 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.
    >
    >
    >
  2. Archived from groups: microsoft.public.windowsxp.general (More info?)

    See...
    Print
    http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/print.mspx

    -----

    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/windows/xp/all/proddocs/en-us/dir.mspx

    -----

    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/Windows/2000/server/reskit/en-us/Default.asp?url=/resources/documentation/Windows/2000/server/reskit/en-us/regentry/29890.asp


    --
    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.
  3. 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
  4. 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.
    : >
    : >
    : >
    :
    :
  5. 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/windows/xp/all/proddocs/en-us/print.mspx
    :
    : -----
    :
    : 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/windows/xp/all/proddocs/en-us/dir.mspx
    :
    : -----
    :
    : 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/Windows/2000/server/reskit/en-us/Default.asp?url=/resources/documentation/Windows/2000/server/reskit/en-us/regentry/29890.asp
    :
    :
    : --
    : 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.
    :
  6. 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
Ask a new question

Read More

Windows Explorer Command Prompt Microsoft Windows XP