Wikipedia:Reference desk/Archives/Computing/2010 September 5

From Wikipedia, the free encyclopedia
Computing desk
< September 4 << Aug | September | Oct >> September 6 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


September 5[edit]

Disk Defragmenter leaves lots of fragments.[edit]

I have just loaded and used 'Defraggler' from Piriform and it appears to leave literally hundreds of fragments and many fragmented files. But it gives no explanation. I then downloaded a trial copy of PerfectDisk 2000 which had great reviews. When I used that it also left loads of fragments and fragmented files but it labelled them as "excluded" as though it was not going to include them in the defrag process. Any ideas what is happening here please? Gurumaister (talk) 15:58, 5 September 2010 (UTC)[reply]

Some system files can't be moved and therefore can't be defragmented. I believe the same goes for any files which are in use be other programs. 82.44.55.25 (talk) 16:19, 5 September 2010 (UTC)[reply]

Thank you. doesn't that mean though that they also can't get fragmented in the first place? And could it account for over a hundred files and about three hundred counted fragments? Gurumaister (talk) 16:49, 5 September 2010 (UTC)[reply]

It's probably talking about the page file. What does the Windows defragmenter tell you when you click "Analyze" and then "View report"? (You can get to it by going to Start --> All Programs --> Accessories --> System Tools). I'm interested in (1) total fragmentation, (2) file fragmentation, and (3) pagefile fragmentation. Also, what is the free space percentage? The most important statistic in answering your question is the pagefile fragmentation. You can try using a program like PageDefrag, but that will only work if you have enough free space.--Best Dog Ever (talk) 20:28, 5 September 2010 (UTC)[reply]
One possible reason for the excluded files is Windows' boot-time optimization. Recent versions of Windows will arrange the clusters of some system files sequentially on the disk in the order they're needed during boot, which fragments those files but actually improves performance. Defragmenting them would be a bad idea. Also, a typical hard drive sequential read speed is ~50MB/sec and a typical seek time is 0.01 sec, so if a file's average fragment size is substantially larger than ~0.5 MB (a 1 GB file in 100 fragments, for example) then it's hardly worth defragmenting it (with the exception of the page file). There's also little point defragmenting files that you hardly ever read, or that are read slowly (e.g. an MP3 or AVI file). I don't know whether the major defragmentation tools implement these kinds of heuristics, though. -- BenRG (talk) 20:53, 5 September 2010 (UTC)[reply]

Why don't you use the Windows defragger Quadrupedaldiprotodont (talk) 14:01, 6 September 2010 (UTC)[reply]

In my experience if you run the defragmenter again it does reduce the fragmentation further. 92.15.11.248 (talk) 15:23, 6 September 2010 (UTC)[reply]

Excel Programming[edit]

I have been instructed, as part of an assignment, to enter this code:

Private Sub Workbook_Open()
RetVal = Shell("C:\Program Files\Windows Media Player\mplayer2.exe C:\My Music\Electricity.mp3")
End Sub

into something called "VBA editor". What is this editor, and how would I go about entering this code? —Preceding unsigned comment added by T.M.M. Dowd (talkcontribs) 17:39, 5 September 2010 (UTC)[reply]

I reformatted your source code above for readability. VBA is "Visual Basic for Applications". In Excel 2003 and earlier, you can access the VBA editor from the menu Tools > Macro > Visual Basic Editor. In Excel 2007 and later, you can access it through the "Visual Basic" item under the "Developer" tab on the ribbon. Alt-F11 is a shortcut in both versions. Once in, you will need to create a new module (menu Insert > Module) into which you can paste the above code. You can then execute the code by clicking on the run icon (green arrow) or pressing F5. If you get a "file not found" error, it is likely that one of the files is located in a different directory that is listed in your source code. You will need to locate then and update your source. -- Tom N (tcncv) talk/contrib 18:27, 5 September 2010 (UTC)[reply]
Thank you very much for your help! It didn't actually work but I think it was almost there. My problem is, I am trying to get background music in excel 2003, which I have been trying to do for the best part of a month with no avail. --T.M.M. Dowd (talk) 18:40, 5 September 2010 (UTC)[reply]

date[edit]

I have around 3,000 files who's creation and modified dates are 2064 because that's what the system date was set to on my old computer. They're should be dated 2003. The month and day are correct however. How can I convert them all to the right date? 82.44.55.25 (talk) 17:58, 5 September 2010 (UTC)[reply]

If you're running any kind of Unix, the "touch" command does what you want. If you're not, tell us what you're running. Marnanel (talk) 18:00, 5 September 2010 (UTC)[reply]
Windows 7 82.44.55.25 (talk) 19:11, 5 September 2010 (UTC)[reply]
We also need to know the file system. By default, Windows 7 will use NTFS, so you can modify the create- and modified- times. You can use the xcopy program (part of modern Windows) to copy file contents without copying file create-dates, for NTFS file systems. But if you're using some other file system, this may be impossible. Nimur (talk) 20:21, 5 September 2010 (UTC)[reply]
Yes, it's NTFS. 82.44.55.25 (talk) 20:37, 5 September 2010 (UTC)[reply]
It makes no difference whether it's NTFS or FAT, since they have the same three date stamps and they are modifiable in the same way. -- BenRG (talk) 22:15, 5 September 2010 (UTC)[reply]
Besides FAT32 and NTFS, many other file systems exist for Windows - like NFS or OpenAFS - and these definitely manage timestamps differently. Nimur (talk) 07:33, 6 September 2010 (UTC) [reply]
There are many versions of touch for Windows, but none that I've found support the --forward option that you'd need to change the year without also changing the rest of the time. Even with --forward you'd have to use different offsets for dates before and after February 29 because 2064 is a leap year while 2003 isn't. (Are you sure all of the dates are correct, incidentally?) Also, most ports of Unix touch don't let you set the creation time, and I imagine many of them will fail (in unpredictable ways) when faced with years after 2038. On the other hand, you could do this pretty easily with any half-decent programming language. Windows PowerShell is one possibility, but I haven't learned it yet. -- BenRG (talk) 22:15, 5 September 2010 (UTC)[reply]
You don't need touch. The dos/windows command copy can also change the modification time of a file. Microsoft explains it here: [1].
Quote: Changing the time and date of a file
If you want to assign the current time and date to a file without modifying the file, use the following syntax:
copy /b Source+,,
The commas indicate the omission of the Destination parameter. 93.95.251.162 (talk) 14:37, 10 September 2010 (UTC) Martin.[reply]
To do this on many files you would need to type a command something like this:
for %i in (*.*) do copy /b %i+,,
I should point out that this is untested, since I use a different system. Also you might want to backup the files before trying anything like this. 93.95.251.162 (talk) 15:12, 10 September 2010 (UTC) Martin.[reply]

Divx wrapped in AVI container[edit]

Supposedly my new phone can play divx videos "wrapped in AVI container." The video I want to play has .divx extension. Do I just need to change the extension to .AVI and that "wraps it in an AVI container?" Or is there more to it than that? The Hero of This Nation (talk) 20:25, 5 September 2010 (UTC)[reply]

Changing the extension to .avi won't change the Container format (digital). However, .divx files (DivX Media Format) are backwards compatible with .avi, and should play on your device. If the .divx file contains chapters or subtitles those won't work, but the main video and audio should. 82.44.55.25 (talk) 20:33, 5 September 2010 (UTC)[reply]