Help: Possible to make a Defragger?

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
4 posts Page 1 of 1
Contributors
User avatar
3aaBrSbeel
Top Poster
Top Poster
Posts: 139
Joined: Fri Jun 01, 2012 9:34 am

Hey, guys. I'm needing of help on making a defragger without help from anti-viruses. I know that there is a system defragger on all computers but don't know how and also the codes. Can you help me? idoit;
Code'n'Stuff Signature Of 3aaBrSbeel
®║▌│█│║▌║││█║▌║▌║▌
✔ Verified Official Code'n'Stuff account ᵀᴴᴱ ᴼᴿᴵᴳᴵᴻᴬᴸ
Image
User avatar
Shim
VIP - Donator
VIP - Donator
Posts: 882
Joined: Wed Dec 14, 2011 5:02 am

Re: Help: Possible to make a Defragger?
Shim
i dont defrag i was able find this
Code: Select all
  Dim ComputerName As String = ""
        Dim wmi As New ManagementObjectSearcher("Select * from Win32_Volume Where Name = 'C:\\'")


        Dim volumes As ManagementObjectCollection

        volumes = wmi.Get()

        For Each Volume As ManagementObject In volumes
            Volume.InvokeMethod("Defrag", Nothing)
        Next
dont forget to add system.management

this could help you some times http://msdn.microsoft.com/en-us/library ... 85%29.aspx :)
Find my programs on Softpedia
User avatar
3aaBrSbeel
Top Poster
Top Poster
Posts: 139
Joined: Fri Jun 01, 2012 9:34 am

Hello, #mshimranpro. Sorry, I couldn't find System.Management.dll. I know it's in Reference in my Projects Properties but I wouldn't add.
Code'n'Stuff Signature Of 3aaBrSbeel
®║▌│█│║▌║││█║▌║▌║▌
✔ Verified Official Code'n'Stuff account ᵀᴴᴱ ᴼᴿᴵᴳᴵᴻᴬᴸ
Image
User avatar
smashapps
Coding Guru
Coding Guru
Posts: 961
Joined: Tue Apr 05, 2011 8:41 am

This might be a possible solution:

"The problem happens because System.Management.dll is not referenced by VB.NET compiler by default. In contrast, C# compiler references to this DLL by default in your csc.rsp file. The simpliest way to resolve the issue is to add the following content in the web.config file of your web application, or if you don't have this file, add one with the content below. -- Andy Cheung Microsoft WMI Test Engineer This posting is provided "As Is" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm"

Source: http://forums.asp.net/t/46697.aspx
My name is Tom | Visit my blog where I post new content every day! Tom's Daily Blog | MineCraft is awesome!
4 posts Page 1 of 1
Return to “Coding Help & Support”