473,386 Members | 1,602 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

VB.NET Defragment a file

Hello all, I'm wondering if it is possible to defrag a single file using VB in order to speed up that same file's access time....

I have determined that my application runs a lot faster that way, but it's kind of a pain to defrag the whole disk each time.

Thanks in advance...!
Dec 18 '07 #1
3 2399
phvfl
173 Expert 100+
Hi,

Defragging a single file is not something specific to VB.NET. A quick google search turned up a tool which looks like what you want.

Please note that I have not looked at this app in depth or used it so you might want to do some more research before using it.

If your files are becoming defragmented quickly enough to affect performance and require regular defragging it would be recommended to look at the problem instead of the sympton. Try finding out why the file fragments so quickly and possibly review the code if it is causing such a hit to performance.
Dec 18 '07 #2
I have revised and perfected this code over and over again, but the problem is always the same, my "Database" keeps growing and the bigger it gets, the slower it is to look through it....

The code is pretty straight forward and it doesn't mess anything up.

Anyway, I'm pretty sure there's also a way to program my own file defrag application with VB, I just have no idea where to start.

Thanks for the reply though.
Dec 18 '07 #3
Plater
7,872 Expert 4TB
I would say that fragmented file structure is not what is slowing down your database. It's probably bloated and in need of compacting and such.
I believe most modern database implementations (ms sql, mysql, oracle) have settings for this.
Dec 18 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
7
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. ...
1
by: kmounkhaty | last post by:
Hi guru, I've been new company for only a month and started analysing Index Fragmentation. After I ran DBCC DBREINDEX and capture data into permanent table, I 've seen lots of tables with no...
3
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
2
by: Jay King | last post by:
I want to create a small deframentor that will defragment a file that I specify. Any Api..?
3
by: nethajireddy | last post by:
Hi, Can any one help me out that how can we defragment the remote pc by any command prompt like that. (not by using Remote desktop) Thanks in advance... ...
1
by: aquasudha | last post by:
hai experts explain to Beginer 1.please explain the processes during defragment? 2.what is fragmented files? n how it's forming? 3.how often i defragment my pc? 4.can i stop defragment process...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.