To add Hard Drive Free and Used Space information display, when 'Y' button is pressed.

Paste the following code at the end of default.xip/default.xap file:
CODE
//
// HDD Space.
//
function GetXboxHardDiskStats()
{
var DDPartition;
var nFreeSpace = 0;
var nTotalSpace = 0;
var nArraySize = 7; // Can be 4 or 7.
var hddInfo = " XBOX HARD DISK\n";
DDPartition = new Array(nArraySize);
DDPartition[1] = "C:";
DDPartition[2] = "E:";
DDPartition[3] = "F:";
DDPartition[4] = "G:";
DDPartition[5] = "X:";
DDPartition[6] = "Y:";
DDPartition[7] = "Z:";
for (var i = 1; i < nArraySize + 1; i = i + 1)
{
nFreeSpace = theHardDrive.GetFreeSpace(DDPartition[i] + "\\");
nTotalSpace = theHardDrive.GetTotalSpace(DDPartition[i] + "\\");
if(nTotalSpace != 0){
hddInfo = hddInfo + DDPartition[i] + " " + nFreeSpace + "MB of " + nTotalSpace + "MB\r";
}
}
TellUser(theTranslator.Translate(hddInfo),"");
}
//
// End.
//
To view HHD information from the main menu when the 'Y' button is pressed, find the following in default.xip/default.xap:
CODE
DEF theMainMenu Level
{
..........
control DEF theMainMenuJoy Joystick
{
function OnADown()
{
..............
}
or to view it from the Hard Drive menu (I have it on both), find the following in default.xip/hard_drive.xap:
CODE
DEF theHardDriveMenu Level
{
..........
control DEF theMainMenuJoy Joystick
{
function OnADown()
{
..............
}
and insert this code (below) after the 'OnADown()' function.
CODE
//
// XBox Hard Disk Space Information.
//
function OnYDown()
{
PlaySoundB();
GetXboxHardDiskStats();
}
//
// End.
//
You don't need to use 'OnYDown()' function, your could use any of the other buttons, with the exception of 'A' and 'B', 'B' can be used from the main menu, but I have the quick shutdown function assigned to 'B' for my main menu.
Done!