Perkentha1
asked on
File Manipulation with Batch files
Currently I have ...
dir "Documents and Settings" /b %1 > c:\test.txt
dumps local profiles to a txt file.
User1
User2
User3
User4
I need to have them as a variable to perform aditional tasks.
How can this be performed?
dir "Documents and Settings" /b %1 > c:\test.txt
dumps local profiles to a txt file.
User1
User2
User3
User4
I need to have them as a variable to perform aditional tasks.
How can this be performed?
For more information, type FOR /? at a command prompt - Basically, you're saying to cycle through the file C:\test.txt and assign the first item (delimited by default by a tab or space) to the variable %%a in each loop.
ASKER
Okay now my last part is Excluding the All Users directory with comes out as "All"
ASKER
I increased the points for the additional question.
Thanks for the help your above statement worked.
Thanks for the help your above statement worked.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you both for your comments, The blank line did return an error but none-the-less I found use for the statement amit so I accredited you a potion of the kitty.
Leew thank you very much for the assistance, I never realized you could do IF statements inside a FOR statement, I was a little narrow minded.
Leew thank you very much for the assistance, I never realized you could do IF statements inside a FOR statement, I was a little narrow minded.
REM Do what you want here - reference %%a when you want to use a profile directory
)