Solved

Need to show user Windows Explorer

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JSON error 4 71
ASP Focus problem 3 68
CDO.Message not able to send attachement 5 32
Reg Exp to extract Url from string asp 12 16
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

830 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