Solved

Need to show user Windows Explorer

Posted on 2003-10-28
3
243 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
  • 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now