Jump to content

[Need help] - Merge text in 2 text files to another file.

Recommended Posts

5 hours ago, Mcinwwl said:

And again, I tried to do my best with Powershell. tested on PS 2.0/WinXP, both in PS console and Powershell ISE.
Script outputs drive letter, free space, total space and label for each active removable drive (pendrives, portable HDDs, memory cards... and floppy discs :P)

$drives = [System.IO.DriveInfo]::getdrives() | ?{$_.Drivetype -eq "Removable" -and $_.IsReady -eq $true}
foreach ($d in $drives) {Write-host ("$($d.RootDirectory.name.TrimEnd("\"))" + " " + [math]::round(($d.AvailableFreeSpace)/1GB,2) + " " +  [math]::round(($d.TotalSize)/1GB,2) + " " + "$($d.VolumeLabel)")}

That was my output with 4 connected pendrives:  

G: 1.78 1.87 
H: 14.87 29.28 
I: 3.73 3.73 
J: 7.16 7.31 KINGSTON

Hope that was expected.


Hi Mcinwwl, That's greate. And you're a Powershell professional, I guess you didn't really believe in yourself  :P

Just a question, how can I save it and use for batch file when i need a mix-method? Tks

Link to comment
Share on other sites

12 hours ago, gunsmokingman said:

 Here is the results with 2 usb drives plug in to my computer, remove the .txt to make active.



Hi, Gunsmokingman.

I'm sorry.

It work perfect. So problem come from copy-paste issue, not from your code.

Thank you very much.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...