/    Sign up×
Community /Pin to ProfileBookmark

Help… script for directories

Hi all,
i need a script that scan a local directory and put each element in array… this elements are jars my real problem is that i need to make a call like “java -cp “C:...file1.jar;C:...file2.jar;…” but the jars are too many so i need to add a javascript that scan all my directory and make a cal like java -cp on all the directory’s elements

for those who ask… i have tried something like java -cp “C:...*.jar” but it didn’t worked.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@UltimaterJul 09.2007 — Try the [url=https://webdeveloper.com/forum/forumdisplay.php?f=31]Java[/url] forum.
Copy linkTweet thisAlerts:
@TrigauthorJul 09.2007 — My questione was: "i need a script that scan a local directory and put each element in array" i'm working on a text document so need a javascriptlike and so this is the right forum Ultimater
Copy linkTweet thisAlerts:
@UltimaterJul 09.2007 — JavaScript is powerless in this area. JScript (IE's JavaScript) however lets you use ActiveX.
<i>
</i>&lt;script type="text/javascript"&gt;
fn=function(){
alert("Your browser does not support JScript.nTry using Internet Explorer.")
}
&lt;/script&gt;
&lt;script type="text/jscript"&gt;
fn=function(o){

fso=new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFolder(document.getElementById("f2s").value);
var s="";
for (var fc = new Enumerator(f.files); !fc.atEnd(); fc.moveNext()){

if(o==1 &amp;&amp; !/jar/i.test(fso.GetExtensionName(fc.item())))continue
s += fc.item()+"n"
}
alert(s)

}
&lt;/script&gt;

&lt;label&gt;File to Scan: &lt;input type="text" value="C:" id="f2s"&gt;&lt;/label&gt;
&lt;br&gt;
&lt;select id="s"&gt;
&lt;option&gt;*.*&lt;/option&gt;
&lt;option&gt;*.jar&lt;/option&gt;
&lt;/select&gt;
&lt;input type="button" onclick="fn(document.getElementById('s').selectedIndex)" value="Scan Folder"&gt;


If the ActiveX security message gets annoying, convert the file to HTA.
Copy linkTweet thisAlerts:
@TrigauthorJul 09.2007 — thx
×

Success!

Help @Trig spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...