Jump to content

Re: Converting Filesystem trough VBScript not working


Recommended Posts

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

On 15 Wrz, 13:54, "http://books.google.com/books?

id=ifqnAAAACAAJ&dq=inauthor:%22Russ+Manning

%22&lr=&as_brr=0&rview=1&source=gbs_book_other_versions_r&cad=2"

wrote:

> 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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...