kumiko Posted December 18, 2006 Share Posted December 18, 2006 Hi,Was wondering if anyone could help me with this...I'm currently developing a backup app on winxp using php. Need to read the first level of the directory tree with readdir(). If we use windows explorer, we could just type My Computer in the address, and we will get back all the logical and physical drives on the harddisk (e.g. c:\, d:\, e:\, f:\, etc.)I've checked everywhere on the internet. readdir($start_path) seems to require exact path name to start with (such as c:\). There seems to be no way to specify something like readdir("My Computer")Does anyone know how to retrieve all the logical/physical drive names with php on winxp? With the drive names, I could then plug into readdir() and retrieve the directory contents of each drive.Thanks in advance for your help......kumiko Link to comment https://forums.phpfreaks.com/topic/31058-reading-my-computer-using-readdir-to-list-all-logicalphysical-drive-names/ Share on other sites More sharing options...
trq Posted December 18, 2006 Share Posted December 18, 2006 Do a search for infomation about the windows scripting.filesystem object. You will need to accesss it through [url=http://php.net/com]COM[/url]. Link to comment https://forums.phpfreaks.com/topic/31058-reading-my-computer-using-readdir-to-list-all-logicalphysical-drive-names/#findComment-143406 Share on other sites More sharing options...
kumiko Posted December 18, 2006 Author Share Posted December 18, 2006 [quote author=thorpe link=topic=119060.msg487122#msg487122 date=1166421483]Do a search for infomation about the windows scripting.filesystem object. You will need to accesss it through [url=http://php.net/com]COM[/url].[/quote]Anyone mind shedding a bit more light to this stuff about COM.I'm new to COM. Have looked at the php.net/COM page. So what should I put inside[pre]$domainObject = new COM("what_should_be_this?"); [/pre]to get a list of the logical/physical drives?Thanks and Regards,...kumiko Link to comment https://forums.phpfreaks.com/topic/31058-reading-my-computer-using-readdir-to-list-all-logicalphysical-drive-names/#findComment-143435 Share on other sites More sharing options...
trq Posted December 18, 2006 Share Posted December 18, 2006 You would need to use...[code=php:0]$domainObject = new COM("scripting.filesystemobject");[/code]but as I said, you would need to look up the docs for the scripting.filesystem object, its been a long while since Ive dealt with any COM objects or windows scripting. Link to comment https://forums.phpfreaks.com/topic/31058-reading-my-computer-using-readdir-to-list-all-logicalphysical-drive-names/#findComment-143474 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.