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
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
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.
Summary: I think you want to direct the output of dir to the Word path, something like >c:\mydocu~1\Worddocs\dir.doc, dir.doc being the name of the just-created Word document with the dir output. You can then ...
Summary: Well the output needs to be redirected to a variable and not shown on the screen. The output may be multiple lines or just one, it's going to be used for serveral different commands. Here's another ex...
Summary: Hi: I am trying to write a dos batch file that will redirect the output of a command to a variable. There really doesn't seem to be a good way of doing this. If anybody has a clue as to how to call ...