![]() |
create a windows batch file
hey all, I need someone who knows how to write a windows batch file to return a list (in a simple .txt file) of a specific file extension (.dwg) in the current directory that the batch file is run from.
I used to have one of these but canot find or remember how to code it. Can anyone help? |
Code:
dir *.dwg > textfilename.txt |
hmm, thanks that's the stuff. Any ideas about including subdirectories of the folder that the .bat file is located in?
|
cmd /C dir /S *.dwg /A > list.txt
This will close the console after it's finished. And also give you the files located in subdirectories... depending on how much there are you'll maybe want to use the the switch /B with the dir command, then you'll only get the paths written to the text file The command in the batch file would look like this... cmd /C dir /S /B *.dwg /A > list.txt Or easier dir /S /B *.dwg > list.txt That'll close aswell after it has finished |
nevermind, I think I've found what I'm looking for thanks to your prompt :up:
Code:
DIR *.DWG /s /b > DWGlist.txt ahah! there's more lol |
I never did learn how to use dos code properly
basic AutoLisp code, now that I can handle (well mostly). Thanks again :up: |
All works according to plan until I try and use it on a network drive, on the console pops up for a split second and complains about UNC something or other.:cry:
Ah well. |
Go to the folder you want to execute the *.bat from, then just paste the command of the batch file into the console. The console will stay open, and you can read the error message.
|
All times are GMT -5. The time now is 04:22 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.