![]() ![]() ![]() This is a simple bat file that accepts a single argument for the directory you want to list files in and prints file names, creation date and date modified. Var fso = new ActiveXObject("Scripting.FileSystemObject") 2 Answers Sorted by: 3 This creates a CSV file listing.csv with file name, time stamp and size for all files in /some/folder/ and its subfolders: find /some/folder -printf ''P' 'Tc' 's' ' > listing.csv See the documentation for -printf in the manpage for find if you want to use other fields. To export one or more lists, select them and click Export >. Note also that tree is not a PowerShell command but rather a command line executable, so you can use it directly in a command. You also dont need to use Get-ChildItem at all, you can just provide a path to tree: tree /f c:yourmusicfolder > MusicStructure.txt. If ( = 1 || args.Item(0)="" ) folderC = "." Import and export directory lists Click Policies > Common Objects > Lists > Directory Lists. You just need to use tree /F and then it will include the files in the folders. ![]() First lets take the case of files that may only have commas in them. Its not too difficult to cope with these cases. You can also use the build in jscript (every windows has it) and create a hybrid. Double quotes and commas are special characters in CSV files, so if you try the above command on a directory containing files named using such characters, you wont get a valid CSV file. This is not a full script but just an example.Change drive and path to the dir you want list (mind of double slashes in the path).You also should care that the WMIC output is in unicode (unlike the cmd )Īnd WMIC is not available in XP home edition. Wmic datafile where (drive="C:" and path="\\somedir\\somesubdir\\") get Caption,CreationDate,LastModified ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |