Converting Filesystem trough VBScript not working

S

shatztal

The Script is in VBscript an should check if the filesystem is not NTFS, if
not it should convert it. this is what i have but the convert command does
not work .

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objWMIService2 = GetObject("winmgmts:" &
"{impersonationLevel=impersonate,(Shutdown)}!\\" & _
strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk
where drivetype ='3'",,48)
Set colOperatingSystems = objWMIService2.ExecQuery("Select * from
Win32_OperatingSystem")
Set WShell = WScript.CreateObject("Wscript.Shell")

wscript.Echo "We Are making now changes"

for each objItem in colItems
' set objItem = colItems.item(0)
FS = objItem.Filesystem
if FS = "NTFS" then
msgbox "מחשבך מוכן לשימוש תקין"
else
Wscript.Echo "Non NTFS Files"
WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
msgbox "×â€Ã—ž×—שב יתחיל ב×Âתחול בעוד רגעינספורי×Â"
counter = 15
do while counter > 0
Wscript.echo counter
wscript.sleep 1000
counter = counter -1
loop
msgbox "×â€Ã—ž×—שב מבצע ×Âתחול"
For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.Reboot()
Next
end if
next
 
P

Pegasus [MVP]

"shatztal" wrote in message
news:5084E647-4A4D-4E2D-93E2-554D69585A29@microsoft.com...
> The Script is in VBscript an should check if the filesystem is not NTFS,
> if
> not it should convert it. this is what i have but the convert command does
> not work .
>
> On Error Resume Next
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:\" & strComputer & "rootcimv2")
> Set objWMIService2 = GetObject("winmgmts:" &
> "{impersonationLevel=impersonate,(Shutdown)}!\" & _
> strComputer & "rootcimv2")
> Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk
> where drivetype ='3'",,48)
> Set colOperatingSystems = objWMIService2.ExecQuery("Select * from
> Win32_OperatingSystem")
> Set WShell = WScript.CreateObject("Wscript.Shell")
>
> wscript.Echo "We Are making now changes"
>
> for each objItem in colItems
> ' set objItem = colItems.item(0)
> FS = objItem.Filesystem
> if FS = "NTFS" then
> msgbox "????? ???? ?????? ????"
> else
> Wscript.Echo "Non NTFS Files"
> WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
> msgbox "????? ????? ?????? ???? ????? ??????"
> counter = 15
> do while counter > 0
> Wscript.echo counter
> wscript.sleep 1000
> counter = counter -1
> loop
> msgbox "????? ???? ?????"
> For Each objOperatingSystem in colOperatingSystems
> objOperatingSystem.Reboot()
> Next
> end if
> next
>


Some comments about your post:
- You should report what happens and what you see when you run the script.
- Having the statement "On error resume next" on top of the code is not a
good idea. It prevents you from seeing errors that might occur.
- The line
WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
should probably read
WShell.run "cmd.exe /k |echo y |convert " & objItem.DeviceID & " /FS:NTFS
/X"
- This is a Windows XP newsgroup. For involved scripts like this one, you
should post in a VB Scripting newsgroup.
 
S

shatztal

thanks again i will post there
by the way i don't get any erros on the CMD line just that is does not run


"Pegasus [MVP]" wrote:

>
> "shatztal" wrote in message
> news:5084E647-4A4D-4E2D-93E2-554D69585A29@microsoft.com...
> > The Script is in VBscript an should check if the filesystem is not NTFS,
> > if
> > not it should convert it. this is what i have but the convert command does
> > not work .
> >
> > On Error Resume Next
> > strComputer = "."
> > Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")
> > Set objWMIService2 = GetObject("winmgmts:" &
> > "{impersonationLevel=impersonate,(Shutdown)}!" & _
> > strComputer & "rootcimv2")
> > Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk
> > where drivetype ='3'",,48)
> > Set colOperatingSystems = objWMIService2.ExecQuery("Select * from
> > Win32_OperatingSystem")
> > Set WShell = WScript.CreateObject("Wscript.Shell")
> >
> > wscript.Echo "We Are making now changes"
> >
> > for each objItem in colItems
> > ' set objItem = colItems.item(0)
> > FS = objItem.Filesystem
> > if FS = "NTFS" then
> > msgbox "????? ???? ?????? ????"
> > else
> > Wscript.Echo "Non NTFS Files"
> > WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
> > msgbox "????? ????? ?????? ???? ????? ??????"
> > counter = 15
> > do while counter > 0
> > Wscript.echo counter
> > wscript.sleep 1000
> > counter = counter -1
> > loop
> > msgbox "????? ???? ?????"
> > For Each objOperatingSystem in colOperatingSystems
> > objOperatingSystem.Reboot()
> > Next
> > end if
> > next
> >

>
> Some comments about your post:
> - You should report what happens and what you see when you run the script.
> - Having the statement "On error resume next" on top of the code is not a
> good idea. It prevents you from seeing errors that might occur.
> - The line
> WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
> should probably read
> WShell.run "cmd.exe /k |echo y |convert " & objItem.DeviceID & " /FS:NTFS
> /X"
> - This is a Windows XP newsgroup. For involved scripts like this one, you
> should post in a VB Scripting newsgroup.
>
>
>
 
H

http://books.google.com/books?id

On 15 Wrz, 09:03, shatztal wrote:
> The Script is in VBscript an should check if the filesystem is not NTFS, if
> not it should convert it. this is what i have but the convert command does
> not work .
>
>  On Error Resume Next
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:\" & strComputer & "rootcimv2")
> Set objWMIService2 = GetObject("winmgmts:" &
> "{impersonationLevel=impersonate,(Shutdown)}!\" & _
>       strComputer & "rootcimv2")
> Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk
> where drivetype ='3'",,48)
> Set colOperatingSystems = objWMIService2.ExecQuery("Select * from
> Win32_OperatingSystem")
> Set WShell = WScript.CreateObject("Wscript.Shell")
>
> wscript.Echo "We Are making now changes"
>
> for each objItem in colItems
>    ' set objItem = colItems.item(0)
>         FS = objItem.Filesystem
>         if FS = "NTFS" then
>         msgbox "מחשבך מוכן לשימוש תקין"
>         else
>         Wscript.Echo "Non NTFS Files"
>         WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
>         msgbox "×â€Ã—ž×—שב יתחיל ב×Âתחול בעוד רגעינספורי×Â"
>         counter = 15
>         do while counter > 0
>                 Wscript.echo counter
>                 wscript.sleep 1000
>                 counter = counter -1
>         loop    
>         msgbox "×â€Ã—ž×—שב מבצע ×Âתחול"
>         For Each objOperatingSystem in colOperatingSystems
>         objOperatingSystem.Reboot()
>         Next
>         end if
> next
 
H

http://books.google.com/books?id

On 15 Wrz, 09:43, shatztal wrote:
> thanks again i will post there
> by the way i don't get any erros on the CMD line just that is does not run
>
>
>
> "Pegasus [MVP]" wrote:
>
> > "shatztal" wrote in message
> >news:5084E647-4A4D-4E2D-93E2-554D69585A29@microsoft.com...
> > > The Script is in VBscript an should check if the filesystem is not NTFS,
> > > if
> > > not it should convert it. this is what i have but the convert command does
> > > not work .

>
> > > On Error Resume Next
> > > strComputer = "."
> > > Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")
> > > Set objWMIService2 = GetObject("winmgmts:" &
> > > "{impersonationLevel=impersonate,(Shutdown)}!" & _
> > >      strComputer & "rootcimv2")
> > > Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk
> > > where drivetype ='3'",,48)
> > > Set colOperatingSystems = objWMIService2.ExecQuery("Select * from
> > > Win32_OperatingSystem")
> > > Set WShell = WScript.CreateObject("Wscript.Shell")

>
> > > wscript.Echo "We Are making now changes"

>
> > > for each objItem in colItems
> > >   ' set objItem = colItems.item(0)
> > > FS = objItem.Filesystem
> > > if FS = "NTFS" then
> > > msgbox "????? ???? ?????? ????"
> > > else
> > > Wscript.Echo "Non NTFS Files"
> > > WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
> > > msgbox "????? ????? ?????? ???? ????? ??????"
> > > counter = 15
> > > do while counter > 0
> > > Wscript.echo counter
> > > wscript.sleep 1000
> > > counter = counter -1
> > > loop
> > > msgbox "????? ???? ?????"
> > > For Each objOperatingSystem in colOperatingSystems
> > > objOperatingSystem.Reboot()
> > > Next
> > > end if
> > > next

>
> > Some comments about your post:
> > - You should report what happens and what you see when you run the script.
> > - Having the statement "On error resume next" on top of the code is not a
> > good idea. It prevents you from seeing errors that might occur.
> > - The line
> >   WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
> >   should probably read
> >   WShell.run "cmd.exe /k |echo y |convert " & objItem.DeviceID & " /FS:NTFS
> > /X"
> > - This is a Windows XP newsgroup. For involved scripts like this one, you
> > should post in a VB Scripting newsgroup.
 
H

http://books.google.com/books?id

On 15 Wrz, 09:29, "Pegasus [MVP]" wrote:
> "shatztal" wrote in message
>
> news:5084E647-4A4D-4E2D-93E2-554D69585A29@microsoft.com...
>
>
>
>
>
> > The Script is in VBscript an should check if the filesystem is not NTFS,
> > if
> > not it should convert it. this is what i have but the convert command does
> > not work .

>
> > On Error Resume Next
> > strComputer = "."
> > Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")
> > Set objWMIService2 = GetObject("winmgmts:" &
> > "{impersonationLevel=impersonate,(Shutdown)}!" & _
> >      strComputer & "rootcimv2")
> > Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk
> > where drivetype ='3'",,48)
> > Set colOperatingSystems = objWMIService2.ExecQuery("Select * from
> > Win32_OperatingSystem")
> > Set WShell = WScript.CreateObject("Wscript.Shell")

>
> > wscript.Echo "We Are making now changes"

>
> > for each objItem in colItems
> >   ' set objItem = colItems.item(0)
> > FS = objItem.Filesystem
> > if FS = "NTFS" then
> > msgbox "????? ???? ?????? ????"
> > else
> > Wscript.Echo "Non NTFS Files"
> > WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
> > msgbox "????? ????? ?????? ???? ????? ??????"
> > counter = 15
> > do while counter > 0
> > Wscript.echo counter
> > wscript.sleep 1000
> > counter = counter -1
> > loop
> > msgbox "????? ???? ?????"
> > For Each objOperatingSystem in colOperatingSystems
> > objOperatingSystem.Reboot()
> > Next
> > end if
> > next

>
> Some comments about your post:
> - You should report what happens and what you see when you run the script..
> - Having the statement "On error resume next" on top of the code is not a
> good idea. It prevents you from seeing errors that might occur.
> - The line
>   WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
>   should probably read
>   WShell.run "cmd.exe /k |echo y |convert " & objItem.DeviceID & " /FS:NTFS
> /X"
> - This is a Windows XP newsgroup. For involved scripts like this one, you
> should post in a VB Scripting newsgroup.
 
H

http://books.google.com/books?id

On 15 Wrz, 09:29, "Pegasus [MVP]" wrote:
> "shatztal" wrote in message
>
> news:5084E647-4A4D-4E2D-93E2-554D69585A29@microsoft.com...
>
>
>
>
>
> > The Script is in VBscript an should check if the filesystem is not NTFS,
> > if
> > not it should convert it. this is what i have but the convert command does
> > not work .

>
> > On Error Resume Next
> > strComputer = "."
> > Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")
> > Set objWMIService2 = GetObject("winmgmts:" &
> > "{impersonationLevel=impersonate,(Shutdown)}!" & _
> >      strComputer & "rootcimv2")
> > Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk
> > where drivetype ='3'",,48)
> > Set colOperatingSystems = objWMIService2.ExecQuery("Select * from
> > Win32_OperatingSystem")
> > Set WShell = WScript.CreateObject("Wscript.Shell")

>
> > wscript.Echo "We Are making now changes"

>
> > for each objItem in colItems
> >   ' set objItem = colItems.item(0)
> > FS = objItem.Filesystem
> > if FS = "NTFS" then
> > msgbox "????? ???? ?????? ????"
> > else
> > Wscript.Echo "Non NTFS Files"
> > WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
> > msgbox "????? ????? ?????? ???? ????? ??????"
> > counter = 15
> > do while counter > 0
> > Wscript.echo counter
> > wscript.sleep 1000
> > counter = counter -1
> > loop
> > msgbox "????? ???? ?????"
> > For Each objOperatingSystem in colOperatingSystems
> > objOperatingSystem.Reboot()
> > Next
> > end if
> > next

>
> Some comments about your post:
> - You should report what happens and what you see when you run the script..
> - Having the statement "On error resume next" on top of the code is not a
> good idea. It prevents you from seeing errors that might occur.
> - The line
>   WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
>   should probably read
>   WShell.run "cmd.exe /k |echo y |convert " & objItem.DeviceID & " /FS:NTFS
> /X"
> - This is a Windows XP newsgroup. For involved scripts like this one, you
> should post in a VB Scripting newsgroup.
 
H

http://books.google.com/books?id

On 15 Wrz, 09:29, "Pegasus [MVP]" wrote:
> "shatztal" wrote in message
>
> news:5084E647-4A4D-4E2D-93E2-554D69585A29@microsoft.com...
>
>
>
>
>
> > The Script is in VBscript an should check if the filesystem is not NTFS,
> > if
> > not it should convert it. this is what i have but the convert command does
> > not work .

>
> > On Error Resume Next
> > strComputer = "."
> > Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")
> > Set objWMIService2 = GetObject("winmgmts:" &
> > "{impersonationLevel=impersonate,(Shutdown)}!" & _
> >      strComputer & "rootcimv2")
> > Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk
> > where drivetype ='3'",,48)
> > Set colOperatingSystems = objWMIService2.ExecQuery("Select * from
> > Win32_OperatingSystem")
> > Set WShell = WScript.CreateObject("Wscript.Shell")

>
> > wscript.Echo "We Are making now changes"

>
> > for each objItem in colItems
> >   ' set objItem = colItems.item(0)
> > FS = objItem.Filesystem
> > if FS = "NTFS" then
> > msgbox "????? ???? ?????? ????"
> > else
> > Wscript.Echo "Non NTFS Files"
> > WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
> > msgbox "????? ????? ?????? ???? ????? ??????"
> > counter = 15
> > do while counter > 0
> > Wscript.echo counter
> > wscript.sleep 1000
> > counter = counter -1
> > loop
> > msgbox "????? ???? ?????"
> > For Each objOperatingSystem in colOperatingSystems
> > objOperatingSystem.Reboot()
> > Next
> > end if
> > next

>
> Some comments about your post:
> - You should report what happens and what you see when you run the script..
> - Having the statement "On error resume next" on top of the code is not a
> good idea. It prevents you from seeing errors that might occur.
> - The line
>   WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
>   should probably read
>   WShell.run "cmd.exe /k |echo y |convert " & objItem.DeviceID & " /FS:NTFS
> /X"
> - This is a Windows XP newsgroup. For involved scripts like this one, you
> should post in a VB Scripting newsgroup.
 
H

http://books.google.com/books?id

On 15 Wrz, 09:43, shatztal wrote:
> thanks again i will post there
> by the way i don't get any erros on the CMD line just that is does not run"Pegasus [MVP]" wrote:
>
> > "shatztal" wrote in message
> >news:5084E647-4A4D-4E2D-93E2-554D69585A29@microsoft.com...
> > > The Script is in VBscript an should check if the filesystem is not NTFS,
> > > if
> > > not it should convert it. this is what i have but the convert command does
> > > not work .

>
> > > On Error Resume Next
> > > strComputer = "."
> > > Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")
> > > Set objWMIService2 = GetObject("winmgmts:" &
> > > "{impersonationLevel=impersonate,(Shutdown)}!" & _
> > >      strComputer & "rootcimv2")
> > > Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk
> > > where drivetype ='3'",,48)
> > > Set colOperatingSystems = objWMIService2.ExecQuery("Select * from
> > > Win32_OperatingSystem")
> > > Set WShell = WScript.CreateObject("Wscript.Shell")

>
> > > wscript.Echo "We Are making now changes"

>
> > > for each objItem in colItems
> > >   ' set objItem = colItems.item(0)
> > > FS = objItem.Filesystem
> > > if FS = "NTFS" then
> > > msgbox "????? ???? ?????? ????"
> > > else
> > > Wscript.Echo "Non NTFS Files"
> > > WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
> > > msgbox "????? ????? ?????? ???? ????? ??????"
> > > counter = 15
> > > do while counter > 0
> > > Wscript.echo counter
> > > wscript.sleep 1000
> > > counter = counter -1
> > > loop
> > > msgbox "????? ???? ?????"
> > > For Each objOperatingSystem in colOperatingSystems
> > > objOperatingSystem.Reboot()
> > > Next
> > > end if
> > > next

>
> > Some comments about your post:
> > - You should report what happens and what you see when you run the script.
> > - Having the statement "On error resume next" on top of the code is not a
> > good idea. It prevents you from seeing errors that might occur.
> > - The line
> >   WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
> >   should probably read
> >   WShell.run "cmd.exe /k |echo y |convert " & objItem.DeviceID & " /FS:NTFS
> > /X"
> > - This is a Windows XP newsgroup. For involved scripts like this one, you
> > should post in a VB Scripting newsgroup.
 
J

John John - MVP

shatztal wrote:
> thanks again i will post there
> by the way i don't get any erros on the CMD line just that is does not run


Your "quotation marks" are not right and I'm not sure why you put the
echo command in there, this is all that you need:

cmd.exe /k convert c: /FS:NTFS /X

John
 
S

shatztal

thanks all but what you said didn't help
the first Pipe line wasn't neccesseray
cmd echo y | convert c: /FS:NTFS /X
had done it good without PIPE.

echo y is neede cause you need to confirm the reboot when asked

"http://books.google.com/books?id=ifqnAAA" wrote:

> On 15 Wrz, 09:03, shatztal wrote:
> > The Script is in VBscript an should check if the filesystem is not NTFS, if
> > not it should convert it. this is what i have but the convert command does
> > not work .
> >
> > On Error Resume Next
> > strComputer = "."
> > Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")
> > Set objWMIService2 = GetObject("winmgmts:" &
> > "{impersonationLevel=impersonate,(Shutdown)}!" & _
> > strComputer & "rootcimv2")
> > Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk
> > where drivetype ='3'",,48)
> > Set colOperatingSystems = objWMIService2.ExecQuery("Select * from
> > Win32_OperatingSystem")
> > Set WShell = WScript.CreateObject("Wscript.Shell")
> >
> > wscript.Echo "We Are making now changes"
> >
> > for each objItem in colItems
> > ' set objItem = colItems.item(0)
> > FS = objItem.Filesystem
> > if FS = "NTFS" then
> > msgbox "מחשבך מוכן לשימוש תקין"
> > else
> > Wscript.Echo "Non NTFS Files"
> > WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
> > msgbox "×â€Ã—ž×—שב יתחיל ב×Âתחול בעוד רגעינספורי×Â"
> > counter = 15
> > do while counter > 0
> > Wscript.echo counter
> > wscript.sleep 1000
> > counter = counter -1
> > loop
> > msgbox "×â€Ã—ž×—שב מבצע ×Âתחול"
> > For Each objOperatingSystem in colOperatingSystems
> > objOperatingSystem.Reboot()
> > Next
> > end if
> > next

>
>
 
B

Bill in Co.

John John - MVP wrote:
> shatztal

http://books.google.com/books?id=ifqnAAAAC...ersions_r&cad=2
wrote:
>
>> thanks again i will post there
>> by the way i don't get any erros on the CMD line just that is does not
>> run

>
> Your "quotation marks" are not right and I'm not sure why you put the
> echo command in there, this is all that you need:
>
> cmd.exe /k convert c: /FS:NTFS /X
>
> John

That's not the only thing that is errant. That From: user name is errant.
 
G

Gordon

"Bill in Co." wrote in message
news:OqHmkEkNKHA.1268@TK2MSFTNGP04.phx.gbl...
> John John - MVP wrote:
>> shatztal

> http://books.google.com/books?id=ifqnAAAAC...ersions_r&cad=2
> wrote:
>>
>>> thanks again i will post there
>>> by the way i don't get any erros on the CMD line just that is does not
>>> run

>>
>> Your "quotation marks" are not right and I'm not sure why you put the
>> echo command in there, this is all that you need:
>>
>> cmd.exe /k convert c: /FS:NTFS /X
>>
>> John
>
> That's not the only thing that is errant. That From: user name is
> errant.
>

Try clicking the user name and see what happens! I think it's a form of
spam!
 
B

Bill in Co.

Gordon wrote:
> "Bill in Co." wrote in message
> news:OqHmkEkNKHA.1268@TK2MSFTNGP04.phx.gbl...
>> John John - MVP wrote:
>>> shatztal

>> http://books.google.com/books?id=ifqnAAAAC...ersions_r&cad=2
>> wrote:
>>>
>>>> thanks again i will post there
>>>> by the way i don't get any erros on the CMD line just that is does not
>>>> run
>>>
>>> Your "quotation marks" are not right and I'm not sure why you put the
>>> echo command in there, this is all that you need:
>>>
>>> cmd.exe /k convert c: /FS:NTFS /X
>>>
>>> John

>>
>> That's not the only thing that is errant. That From: user name is
>> errant.
>>
>
> Try clicking the user name and see what happens! I think it's a form of
> spam!

So he's a spammer? Why are we even bothering with him, then.
 
J

John John - MVP

The /k switch continues the command session so echo would not be
needed... but I see that you now decided to do away with the switch.

John

shatztal wrote:
> thanks all but what you said didn't help
> the first Pipe line wasn't neccesseray
> cmd echo y | convert c: /FS:NTFS /X
> had done it good without PIPE.
>
> echo y is neede cause you need to confirm the reboot when asked
>
> "http://books.google.com/books?id=ifqnAAA" wrote:
>
>> On 15 Wrz, 09:03, shatztal wrote:
>>> The Script is in VBscript an should check if the filesystem is not NTFS, if
>>> not it should convert it. this is what i have but the convert command does
>>> not work .
>>>
>>> On Error Resume Next
>>> strComputer = "."
>>> Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")
>>> Set objWMIService2 = GetObject("winmgmts:" &
>>> "{impersonationLevel=impersonate,(Shutdown)}!" & _
>>> strComputer & "rootcimv2")
>>> Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk
>>> where drivetype ='3'",,48)
>>> Set colOperatingSystems = objWMIService2.ExecQuery("Select * from
>>> Win32_OperatingSystem")
>>> Set WShell = WScript.CreateObject("Wscript.Shell")
>>>
>>> wscript.Echo "We Are making now changes"
>>>
>>> for each objItem in colItems
>>> ' set objItem = colItems.item(0)
>>> FS = objItem.Filesystem
>>> if FS = "NTFS" then
>>> msgbox "מחשבך מוכן לשימוש תקין"
>>> else
>>> Wscript.Echo "Non NTFS Files"
>>> WShell.run "cmd.exe /k |echo y |convert c: /FS:NTFS /X"
>>> msgbox "×â€Ã—ž×—שב יתחיל ב×Âתחול בעוד רגעינספורי×Â"
>>> counter = 15
>>> do while counter > 0
>>> Wscript.echo counter
>>> wscript.sleep 1000
>>> counter = counter -1
>>> loop
>>> msgbox "×â€Ã—ž×—שב מבצע ×Âתחול"
>>> For Each objOperatingSystem in colOperatingSystems
>>> objOperatingSystem.Reboot()
>>> Next
>>> end if
>>> next

>>
 

Similar threads

H
Replies
0
Views
229
http://books.google.com/books?id
H
Back
Top Bottom