- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsI wrote a VB application that runs fine on one server. When I transfered it to another server I keep on getting the error: run-time error '438': Object doesn't support this property or method
The error is regarding the line: wshShell.CurrentDirectory = "T:\cs.biu.ac.il\scripts"
Please see the code below and tell me what you think:
Public Sub FindUser(ID As String)
Dim wshShell
Set wshShell = CreateObject("WScript.Shel
'map network drive
Dim Connect
Set Connect = CreateObject("WScript.Netw
Connect.MapNetworkDrive "T:", "\\star\SYSVOL"
wshShell.CurrentDirectory = "T:\cs.biu.ac.il\scripts"
'create random file name
Dim fName As String
Dim objFSO1
Set objFSO1 = CreateObject("Scripting.Fi
fName = CreateRandomFileName()
Do While objFSO1.FileExists(fName)
fName = CreateRandomFileName()
Loop
'execute search
Dim myCommand As String
phoneNo = ID
myCommand = "cscript search.vbs LDAP://DC=ch,DC=cs,DC=biu,
'wshShell.Run "cmd.exe /C " & myCommand & " > temp.txt"
wshShell.Run "cmd.exe /C " & myCommand & " > " & fName
'delete drive mapping
wshShell.CurrentDirectory = "C:\"
MsgBox "stam - doesn't create file without this printing - ask pinchas"
Connect.RemoveNetworkDrive
'parsing output file
wshShell.CurrentDirectory = "\\star\SYSVOL\cs.biu.ac.i
Dim objFSO, objTextFile
Dim strLinetoParse, begining, arrToken, num, strDN As String
Set objFSO = CreateObject("Scripting.Fi
Set objTextFile = objFSO.OpenTextFile(fName,
Do While objTextFile.AtEndOfStream <> True
strLinetoParse = objTextFile.ReadLine
begining = Mid(strLinetoParse, 1, 7)
'catches only first instance. If all instances are required remove exit do
If begining = "ADsPath" Then
arrToken = Split(strLinetoParse, " ")
num = arrToken(1)
strDN = arrToken(3)
'MsgBox strDN
Exit Do
End If
Loop
'MsgBox "Number of results is: " & num
objTextFile.Close
objFSO.DeleteFile (fName)
Set wshShell = Nothing
Set Connect = Nothing
path = strDN
End Sub
Thanks.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: chayahd99Posted on 2003-10-12 at 07:06:28ID: 9535696
I found the solution by myself.
The error was caused because WSH 5.6 is required on the second server. On the first server it is installed and once I installed it on the second server, the app works fine.