#94386 - 2002-10-15 03:21 PM
DIR /N command in a script
|
Anonymous
Anonymous
Unregistered
|
The text below is part of a script I have written. I am haveing one small problem with it. The shell command line isn't working correctly. When the script runs, it doesn't like the /N switch in the DIR command. But if I go to a command prompt and type the same exact command, it works fine!! Can anyone help? Thanks!!
code:
$DIRLOC=E:\USERS
SHELL "COMMAND.COM /E:1024 /C DIR $DIRLOC /AD /B /N > $DIRLOC\HOMES.TXT"
|
|
Top
|
|
|
|
#94388 - 2002-10-15 03:34 PM
Re: DIR /N command in a script
|
Anonymous
Anonymous
Unregistered
|
This is on a Windows NT 4 SP6a server. The /B is for Bare format and the /N is to display the long version of a long file name. One switch shouldn't over ride the other switch in this case. And like I said, it just doesn't work when put in to a Kixtart script.
/B Uses bare format (no heading information or summary). /N New long list format where filenames are on the far right.
|
|
Top
|
|
|
|
#94390 - 2002-10-15 04:06 PM
Re: DIR /N command in a script
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
This is from Windows XP..
quote:
C:\>dir /? Displays a list of files and subdirectories in a directory.
DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] [/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]
[drive:][path][filename] Specifies drive, directory, and/or files to list.
/A Displays files with specified attributes. attributes D Directories R Read-only files H Hidden files A Files ready for archiving S System files - Prefix meaning not /B Uses bare format (no heading information or summary). /C Display the thousand separator in file sizes. This is the default. Use /-C to disable display of separator. /D Same as wide but files are list sorted by column. /L Uses lowercase. /N New long list format where filenames are on the far right.
HTH,
Kent [ 15. October 2002, 16:07: Message edited by: kdyer ]
|
|
Top
|
|
|
|
#94394 - 2002-10-15 04:20 PM
Re: DIR /N command in a script
|
Anonymous
Anonymous
Unregistered
|
I got it!! Thanks for everyones input. Lonkero was on the right track, with the COMMAND.COM and CMD.EXE. Here's the line that works!!
code:
SHELL "CMD.EXE /E:1024 /C DIR $DIRLOC /AD /B /N > $DIRLOC\HOMES.TXT"
|
|
Top
|
|
|
|
#94398 - 2002-10-15 04:47 PM
Re: DIR /N command in a script
|
Anonymous
Anonymous
Unregistered
|
Ran it on a Windows NT 4 SP6 a computer. Processed over 225 directories with no problems.
|
|
Top
|
|
|
|
#94400 - 2002-10-15 05:35 PM
Re: DIR /N command in a script
|
Anonymous
Anonymous
Unregistered
|
When I ran it through Kixtart the original way using COMMAND.COM and without the /N switch, folder names over a certain number of characters were being truncated (ex. Usernam~1)
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1110 anonymous users online.
|
|
|