need to perform this vbs script in java

Joined
Sep 6, 2006
Messages
1
Reaction score
0
I have a vbs script that gives me the exact information I need. But I would like to integrate it into a java program I have already coded. (I know java better than vbs) I can't seem to find a way to "port" the function of this script to java.

Code:
Option Explicit
Dim objNetwork, objDrive, intDrive, intNetLetter 

' This is the heart of the script 
' Here is where objDrive enumerates the mapped drives
Set objNetwork = CreateObject("WScript.Network") 
Set objDrive = objNetwork.EnumNetworkDrives 

' Extra section to troubleshoot
If objDrive.Count = 0 Then 
WScript.Echo "No Drives Mapped "
Wscript.Quit(0)
End If 

' Here is the where the script reads the array
For intDrive = 0 to objDrive.Count -1 Step 2
intNetLetter = IntNetLetter +1
WScript.Echo "UNC Path " & intDrive & " - " & objDrive.Item(intDrive)_
& " Mapped drive No : " & objDrive.Item(intDrive +1)
Next 

Wscript.Quit(1)

This is the code that I would like to integrate into my java code. All it does is to enumerate the network drives the pc has connected. I am looking for a specific drive mapping and then verifying the server it is connected to. If that is not possible then is there a way to pull the output of this script into java? "Reading the stack" is something I hear to try but I don’t know how this would be done.

Thanks in advance for the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,039
Messages
2,570,376
Members
47,032
Latest member
OdellBerg4

Latest Threads

Top