Solved

Need to show user Windows Explorer

Posted on 2003-10-28
3
248 Views
Last Modified: 2012-08-13
Hi all,

I want whenever my web page load on user machine at that time, through FSO or any other way. i want to show user their hard disk information like windows explorer does..

waiting for your all kind response.

Sahdev
0
Comment
Question by:SahdevSingh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Expert Comment

by:mr_brij
ID: 9639804
u mean like directories in c drive or the hard disk info .. like how much space used or left ??

if for the directory .. u have the fso.... for the usage will have to check
0
 
LVL 21

Accepted Solution

by:
ap_sajith earned 250 total points
ID: 9640320
Copy the code below and test it out yourself... Btw.. most of the text in there is french..

<html>
<head>
<title>Selection de repertoire</title>
<style type="text/css">
body {
 font-family : Tahoma;
 font-size : xx-small;
}
a, a:hover, a:active {
 font-family : Tahoma;
 font-size : xx-small;
}
div {
 font-family : Tahoma;
 font-size : xx-small;
 border : 1px solid #000000;
 padding : 5px;
}
</style>
<script language="JavaScript">

var FSO;
var sOut = "";
var nl = "<br>" + String.fromCharCode(13);
var ImgPath = "Img/";
var sImgFolder = "&nbsp;&nbsp;&nbsp;<img src=\"" + ImgPath + "folder.gif\"";
sImgFolder += " width=\"15\" height=\"13\" border=\"0\">&nbsp;";
var sImgFolderUp = "&nbsp;&nbsp;&nbsp;<img src=\"" + ImgPath + "folder_up.gif\"";
sImgFolderUp += " width=\"15\" height=\"13\" border=\"0\">&nbsp;";
var sImgDrive = "&nbsp;&nbsp;&nbsp;<img src=\"" + ImgPath + "drive.gif\"";
sImgDrive += " width=\"15\" height=\"13\" border=\"0\">&nbsp;";
var sImgDriveA = "&nbsp;&nbsp;&nbsp;<img src=\"" + ImgPath + "drive_a.gif\"";
sImgDriveA += " width=\"15\" height=\"13\" border=\"0\">&nbsp;";

var DisplayPath = "";

function replaceAll(inSTR, inTOK, inREP) {
 var s;
 s = inSTR + "";
 while (s.indexOf(inTOK) >= 0) {
  s = s.replace(inTOK, "§");
 };
 while (s.indexOf("§") >= 0) {
  s = s.replace("§", inREP);
 };
 return s;
};

function getQuery(inINDX){
 var queryString = location.search;
 if (queryString != "") {
  var data = queryString.slice(1,queryString.length);
  var aData = data.split("&");
  var aOut = aData[inINDX].split("=");
  return aOut[1];
 } else {
  return "NoData";
 }
};

function GetCurrentFolder() {
 return DisplayPath;
};

function GoToDrives() {
 DisplayPath = "";
 GetDrives();
};

function GoToFolder(inFOLDER) {
 DisplayPath = inFOLDER;
 GetFolders();
};

function GetFolders() {
 // Balayage Repertoires
 var rep, sRep, i, t;
 sOut = "";
 sOut += DisplayPath + "<br><br>";
 t = DisplayPath.substring(0, DisplayPath.length - 1);
 t = t.substring(0, t.lastIndexOf(String.fromCharCode(92)) + 1);
 if (t + "" != "") {
  sOut += sImgFolderUp + "<a href=\"javascript:GoToFolder('";
  sOut += replaceAll(t, String.fromCharCode(92), "\\\\") + "');\" border=\"0\">";
  sOut += "Repertoire Parent</a><br>";
 } else {
  sOut += sImgFolderUp + "<a href=\"javascript:GoToDrives();\" border=\"0\">";
  sOut += "Repertoire Parent</a><br>"
 }
 try {
  rep = FSO.GetFolder(DisplayPath);
  var rOK = true;
 }
 catch (e) {
  var rOK = false;
 }
 if (rOK) {
  sRep = new Enumerator(rep.SubFolders);
  if (sRep.atEnd()) {
   sOut += "&nbsp;&nbsp;&nbsp;Pas de sous-repertoires";
  } else {
   for (i = 0; !sRep.atEnd(); sRep.moveNext()) {
    sOut += sImgFolder + "<a href=\"javascript:GoToFolder('";
    sOut += replaceAll(sRep.item(), String.fromCharCode(92), "\\\\") + "\\\\');\" border=\"0\">";
    sOut += sRep.item() + "\\</a>" + nl;
   };
  }
 } else {
  sOut += "&nbsp;&nbsp;&nbsp;Pas de sous-repertoires";
 }
 document.getElementById("SRInterface").innerHTML = sOut;
}

function GetDrives() {
 // Balayage Disques
 var drv, i;
 sOut = "";
 sOut += "Poste de travail<br><br>";
 var drvGlo = new Enumerator(FSO.Drives);
 for (i = 0; !drvGlo.atEnd(); drvGlo.moveNext()) {
  drv = drvGlo.item();
  if (drv.DriveType == 2) {
   sOut += sImgDrive + "<a href=\"javascript:GoToFolder('";
   sOut += drv.DriveLetter + ":\\\\');\" border=\"0\">";
   sOut += drv.DriveLetter + ":\\</a>" + nl;
  } else if (drv.DriveType == 1) {
   sOut += sImgDriveA + "<a href=\"javascript:GoToFolder('";
   sOut += drv.DriveLetter + ":\\\\');\" border=\"0\">";
   sOut += drv.DriveLetter + ":\\</a>" + nl;
  }
 };
 document.getElementById("SRInterface").innerHTML = sOut;
};

function DoLoad() {
 var ActiveXOK;
 try {
  var FSOT = new ActiveXObject("Scripting.FileSystemObject");
  ActiveXOK = true;
 }
 catch (e) {
  ActiveXOK = false;
 }
 if (ActiveXOK) {
  FSOT = null;
  FSO = new ActiveXObject("Scripting.FileSystemObject");
  GetDrives();
 } else {
  var lf = "<br>" + String.fromCharCode(13);
  sOut = "";
  sOut += "Ce script est dedié Internet Explorer." + lf;
  sOut += "L'utilisation de ce script nécessite une configuration de la securite de votre navigateur." + lf;
  sOut += "Allez dans Menu Outils > Options Internet >";
  sOut += " Sécurité > Personnaliser le niveau > Contrôles ActiveX et plugins" + lf;
  sOut += "Authorisez l'utilisation des composants ActiveX."
  document.getElementById("SRInterface").innerHTML = sOut;
 }
};
</script>
</head>

<body onLoad="DoLoad();">
<div id="SRInterface"></div>
<br>
<br>
<a href="javascript:alert(GetCurrentFolder());" border="0">
Recuperer le repertoire en cours (javascript:GetCurrentFolder();)
</a>
</body>
</html>

Cheers!!
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 9649373
why just grade b??. The above solution is exactly what you asked for!

Cheers!!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question