r/ScriptSwap • • Apr 06 '21

help modifying script to make CSV report of your drive

Hi i need some help regarding a script for windows. i have found some script from here

about a script that will make a csv report of your machine drives partition letter. total size. and free space.

https://stackoverflow.com/questions/51541391/batch-script-to-get-total-free-available-size-of-disks

but since i want to include a drive percentage and time stamp of when the data is captured i try adding more commands like

"Wscript.Echo "Percent Free Space:," & vbTab & _ oD.PercentFreeSpace" (and some variation of that)

to show percentage of the drive. it can run on my personal pc and get the percentage data but somehow it didn't work on my laptop.

and also i need help to figure out how to put a time stamp on the csv files to be honest im a bit of a pincone regarding to batch scripting because i have no idea what's their method of capturing time. i already tried using vbscript to get time that i found in w3school which is

"response.write(Time)" yet it didn't really give out any information and broke the rest of the batch file

so i need help/hint or suggestion because to be honest i really have no idea because i only know some basic script

7 Upvotes

5 comments sorted by

0

u/[deleted] Apr 06 '21

[deleted] — view deleted comment

1

u/Original_Collar_9764 Apr 06 '21

i've tried looking for alternative and powershell comes out often but i just couldn't find the guide to create powershell batch file to create the report to a csv files. so yea but if you have any information like a course or something i will try it out