Computing.Net > Forums > Disk Operating System > output of dir to variable

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

output of dir to variable

Reply to Message Icon

Name: Nathan
Date: November 7, 2003 at 19:34:21 Pacific
OS: win xp
CPU/Ram: 512
Comment:

Hi I have an easy question but for some reason I dont remember how to do this. its simple I have "dir unenc /b" and I want to get it into a variable. not as easy as I thought. oh one other thing this file MAY NOT use other files also I dont want it to be very large as what I used to use for this was a very small little thing



Sponsored Link
Ads by Google

Response Number 1
Name: Brian HANLON
Date: November 8, 2003 at 06:23:45 Pacific
Reply:

Pop over to:
http://home.mnet-online.de/horst.muc/index.html
(or just hit the "Homepage" link above - not my HP, but the easiest way to set a clickable link.)
and have a look at:
LMOD
Versatile line/list modification tool to generate lists of commands, set variables to anything extracted from (DOS) output, and more.. Win NT/2000 compatible.

Should dolve your problem if it is DIR OUTPUT you need to handle.
If the question is actually "How to set a DOS variable to that phrase" then simply:
SET VAR001=DIR unenc /b
will have %VAR001% represent the phrase.

Baldy.


0

Response Number 2
Name: dtech10
Date: November 8, 2003 at 14:29:56 Pacific
Reply:

With XP you can also set var using the example below

dir unenc /b > dir.txt
set /p dir=<dir.txt


0

Response Number 3
Name: dtech10
Date: November 8, 2003 at 14:32:35 Pacific
Reply:

Hi
sorry about the above the lines above should have been

dir unenc /b > dir.txt
set /p dir<=dir.txt



0

Response Number 4
Name: nathan
Date: November 8, 2003 at 17:59:41 Pacific
Reply:

neither will suffice. the first one involves 3rd party correct? I didnt follow link but thats what I got from it. and and 2nd one involves extra files. that was my problem. it cannot use outside files.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: output of dir to variable

Directory Print from DOS to Word www.computing.net/answers/dos/directory-print-from-dos-to-word/11559.html

Command output to variable www.computing.net/answers/dos/command-output-to-variable/7847.html

Redirection of command output to variabl www.computing.net/answers/dos/redirection-of-command-output-to-variabl/8744.html