Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.
Batch File Directory Listing
Name: WhSox21 Date: June 28, 2005 at 07:39:49 Pacific OS: Win XP Pro CPU/Ram: 512
Comment:
I'm having one major pain with this batch File.
Here's the code: @echo off set CurrentPath="C:\current\" set BackUps="C:\BackUps\" CD %BackUps% for /f %%R in ("dir/s/b/ad %BackUps%") do call :1 %%R goto :eof
:1 %1 echo %1>Done.txt pause
Rather than placing the name of the directory in Done.txt it places this: dir/s/b/ad
I have no idea how to fix this. Anyone help me with this problem?
Name: dtech10 Date: June 28, 2005 at 14:11:57 Pacific
Reply:
@echo off set CurrentPath="C:\current\" set BackUps="C:\BackUps\" CD %BackUps% rem Empty Done.txt type null > Done.txt rem Don't need %Backup% because you're already changed to it. for /f %%R in ('dir /s /b /ad') do call :1 %%R goto :eof
:1 %1 echo %1>>Done.txt pause
0
Response Number 2
Name: chrisintx Date: June 29, 2005 at 10:52:11 Pacific
Reply:
would like some help building a simple batch file collecting information from my computers...ip address, mac address and so on and then writing findings to a txt file
0
Response Number 3
Name: dtech10 Date: June 30, 2005 at 12:04:42 Pacific
Reply:
Hi Chrisintx Not quite sure what data you want, but will this help..
ipconfig /all > data.txt
0
Response Number 4
Name: lachlanmullen Date: June 30, 2005 at 15:13:52 Pacific
Reply:
dtech10,
When I run that batch it processes ('dir /s /b /ad') sequentially, each time telling me they are invalid commands, and ignoring the single quotes.
any advice?
0
Response Number 5
Name: dtech10 Date: July 1, 2005 at 15:05:59 Pacific
Reply:
Hi Not quite sure are you using the right quotes. On my keyboard these are "`" and "'" Im using the second with is on my "@" key.
Summary: Hi, I need a batch file to list the directory name satisfying the following condition: -Display directory names which are greater than or equal to 7days old from the last modification date. ...
Summary: Hello, I need a batch file to list all directories which are 30days old in a specified path. Example C:\Sample\ Here all the directories which are 30days old from the modified date must be listed...
Summary: Hi.. I am creating a batch file to replace a word in all the text files in a directory. File Example:- FILE 1:- "ISA*00* *00* *ZZ*ABCDEFGHI *ZZ*ABCDEFG " FILE 2:- "ISA*...