Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Change CDROM drive letter based on objItem.DeviceID

$
0
0

Good start was in: http://blogs.technet.com/b/heyscriptingguy/archive/2011/03/14/change-drive-letters-and-labels-via-a-simple-powershell-command.aspx
but does not actually seem to work (Win 7 x64)

Get-WmiObject Win32_CDROMDrive

does not actually display much, but could just use it like:

$drive = get-WmiObject win32_cdromdrive -filter "Caption = 'ELBY CLONEDRIVE SCSI CdRom Device'"

but then the following one fails:

PS C:\Windows\system32> Set-WmiInstance -inputobject $drive -Arguments @{Drive="U:"}
Set-WmiInstance : Provider is not capable of the attempted operation
At line:1 char:16
+ Set-WmiInstance <<<<  -inputobject $drive -Arguments @{Drive="U:"}
    + CategoryInfo          : InvalidOperation: (:) [Set-WmiInstance], ManagementException
    + FullyQualifiedErrorId : SetWMIManagementException,Microsoft.PowerShell.Commands.SetWmiInstance

Anybody having any good idea how to get it going?

Thanks

Seb


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>