Both hilander999's solution (a paraglider script) and philon's suggestion of calling profiles.exe from ClearRAMdrv.cmd are OK solutions... I noticed this bug quite some time ago and fixed it using a similar solution - looks like I probably should have mentioned it earlier...

But in the meantime:
Currently, UBCD4Win uses
profiles.exe written by
tonedeaf from 911cd.net (
THREAD); and while it works well, it is an AutoIT compiled script (then UPX'd -
SOURCE). Since I'm not a programmer, but like the option of customizing PE to my liking, I decided to use my own method of "profiles" creation. It is easy and customizable, and addresses some of the shortcomings I find with the above solutions. This is just my solution among, I'm sure, many.
The shortcomings are as I see them (albeit minor in my opinion):
- as previously mentioned, tonedeaf's RAMProfiles plugin is written with AutoIT, making it difficult for the non-programmer to customize. Of even less importance, but nonetheless present, is it's size - due to the nature of an AutoIT compilation, the EXE is 275kb uncompressed and 144kb compressed.
- with paraglider's script, while it elegantly deletes everything in the RAMDrive except files located in Documents and Settings (the "profiles"), unfortunately, many programs copy files to Documents and Settings, robbing you of potentially precious RAMDrive space.
This is why I continue to support the notion of formatting the RAMDrive and recreating the profiles. My "personal-use" method involves only a SFX_RAR file to create the Documents and Settings folders in the RAMDrive and registry entries. The SFX_RAR is 55kb.
Here are some real-world examples of why I believe formatting the RAMDrive is the superior option:
Immediately after booting PE I checked the size of my RAMDrive and found the following:
The only thing occupying the RAMDrive are folders (why almost 4.4MB are "used" is still a mystery to me - more on that later)
I decided to run many of the apps that use the RAMDrive on my personal build and test from there... here is a screenshot of my RAMDrive showing what apps I ran.
Here is the amount of spaced used by the apps in the RAMDrive:
I then closed all the apps and ran paraglider's script deleting everything but what is occupied in Documents and Settings. As you can see, 7.5MB of RAMDrive space remains occupied:
I then formatted b:\ with ClearRAMdrv.cmd, and got the following results:
As you can see, the "delete everything but Documets and Settings" script left many files in the "profiles" robbing me of about 5MB of RAMDrive space.
Admittedly, the amount of space saved with such a sizeable RAMDrive is negligible, not everyone or every machine has this luxury - so the point ought to be that, when clearing the RAMDrive, it ought to free up as much space as possible.
The lines in my ClearRAMdrv.cmd are simply:
format %ramdrv% /FS:NTFS /V:RAMDisk /Q /C /x /FORCE
start/wait %systemroot%\system32\Documents.and.Settings_SFX.exe
exit
Essentially, my
Documents.and.Settings_SFX.exe simply replaces
profiles.exe.
@MattInLA:
I don't understand your last post - I added your lines:
cd %windir%\system32
profiles
to ClearRAMdrv1.cmd (a file made for testing), and ran it after booting to PE with no results.
ClearRAMdrv.cmd is not called on during or after boot, so I'm not clear what these lines could accomplish. Perhaps you are referring to something I'm missing...
DW
NOTE: Since I don't have access to any "beta" sections, I am unaware of any potential changes which might be better than the solution I've used for my personal builds. My apologies for not solving this sooner - immediately after the ClearRAMdrv plugin was encorporated into UBCD4Win, I noticed and fixed the bug - but forgot about it and never mentioned my results. Should there be interest after examining any beta versions, I'll consider posting my plugin. It varies only slightly from the current plugin but fixes the problem.
