hfrfc Posted October 3, 2005 Share Posted October 3, 2005 (edited) HelloI need to check destination drive before installing some appz.The G: drive must be present. How can you do that ? Btw i want ot check if at least 500 MB of drive is available.Is it possible ?thx Edited October 4, 2005 by hfrfc Link to comment Share on other sites More sharing options...
Doc Symbiosis Posted October 9, 2005 Share Posted October 9, 2005 At which time do you want to check for the free space? In a batchfile you could use the following line to put the free space on the partition, where your %PROGRAMFILES%-folder is located:For /f "usebackq tokens=3" %%i IN (`dir %PROGRAMFILES%`) DO set free=%%iTo check, if the drive g: is present, you can use the following lineFor /f "usebackq tokens=1" %%j IN (`fsutil fsinfo volumeinfo z:`) DO set error=%%jAfter using this, and the drive is not present, the variable %error% has the value "Error:" (at least, when you are using an englisch windows Link to comment Share on other sites More sharing options...
Jimbeau Posted November 12, 2005 Share Posted November 12, 2005 I use this during my install to verify that the D Partition exists. HTHDim filesysSet filesys = CreateObject("Scripting.FileSystemObject")Dim oshellSet oshell = CreateObject("WScript.Shell")'case 0: drtype = "Unknown" 'case 1: drtype = "Removable" 'case 2: drtype = "Fixed" 'case 3: drtype = "Network" 'case 4: drtype = "CD-ROM" 'case 5: drtype = "RAM Disk" If filesys.DriveExists("d") Then Set drv = filesys.GetDrive("d") Do While drv.DriveType <> 2 msgBox "It appears that there is no D partition!", 0, "Critical Error" msgBox "The disk management console will now be opened. Please create a D partition and change the CD ROM drive letter to E", 0, "D Drive Neccessary" oshell.run "diskmgmt.msc" ,0, True Wscript.Sleep 20000 Loop Result = oshell.Popup("D Partition ready", 3, "App Install", 0)End IfSet filesys = NothingSet oshell = Nothing Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now