#1 20 Jan 2013 13:58

Alexander Ceed
Member
Registered: 25 Sep 2011
Posts: 39

Loop Disable-ComputerRestore

Hello,

I;m trying to make a simple script that will loop through all available drive letters and disable all of them.
This is what I've done so far:

for( $i=67;$i -le 90; $i++ ) { Disable-ComputerRestore [char]$i + ':\' }

It seems the char type is not being processed and the slash is not being accepted.
Please help.

Thank you

Last edited by Alexander Ceed (20 Jan 2013 13:58)

Offline

#2 21 Jan 2013 16:42

jumper
Member
From: tunisia, Mornaguia
Registered: 17 Apr 2009
Posts: 55
Website

Re: Loop Disable-ComputerRestore

hi

try this:

PS II> for( $i=67;$i -le 90; $i++ ) { Disable-ComputerRestore $([char]$i + ':\') }

Last edited by jumper (21 Jan 2013 16:44)

Offline

Board footer

Powered by FluxBB