[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

06/29/2009 at 12:09PM PDT, ID: 24531079
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.7

Wscript.shell Not Returning File List

Asked by wibench in Microsoft Development, Web Development, Scripting Languages

Tags: Wscript

Hello,

We did several window updates this last weekend to our asp.net intranet server.  Since the updates any vb code we had in our web pages no longer return the file lists as they did before.  We do not get any errors, just a blank list when We know there are files present.

Attached is an example of the code we are using.  It is not the most elegant but it was working prior to the updates.  We were thinking maybe a registry setting or some other setting got changed during the update (or not?).

If anyone has any ideas on this it would be greatly appreciated as we are totally stumped.

Sincerely,
wibench
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
sServMapPath = "\\fs1\shared"
If sWCTID = 62 Then
	'BAZ
	sFExt = "mpr"
	sRemMapPath = "\\10.0.0.10\A1"
	sRemDirPath = "\MP4"
	'sServDirPath = "\routerprograms\BAZ"
	sServDirPath = "\ENGINEERING\BAZ_MPR_MASTER"
	sRemUser = "?????"
	sRemPassWord = ""
Else
	'IMA
	sFExt = "fmc"
	sRemMapPath = "\\10.0.0.11\imawop"
	sRemDirPath = "\FMC"
	'sServDirPath = "\routerprograms\IMA"
	sServDirPath = "\ENGINEERING\IMA_FMC_MASTER"
	sRemUser = "??????"
	sRemPassWord = "?????"
End If
 
SET objShell = CreateObject("Wscript.Shell")
RemoteList = GetFileList("N:", sRemMapPath, sRemDirPath & "\*." & sFExt)
ServerList = GetFileList("Q:", sServMapPath, sServDirPath & "\*." & sFExt)
 
 
Function GetFileList(sDrive, sMapPath, sSearch)
	DeleteMapDrive(sDrive)
	Call MapDriveLetter(sDrive, sMapPath)
	sCMD = "dir /B " & sDrive & sSearch
	SET objExec = objShell.Exec("%comspec% /c " & sCMD)
	WHILE objExec.Status <> WshFinished
		'Wait for the command to be run completely 
	WEND 
	GetFileList = UCase(Replace(Replace(objExec.StdOut.ReadAll,Chr(13),","),Chr(10),""))
	'GetFileList = objExec.StdOut.ReadAll
	WHILE objExec.Status <> WshFinished
		'Wait for the command to be run completely 
	WEND 
	'MsgBox("-" & GetFileList & "-")
	DeleteMapDrive(sDrive)
End Function
 
Function DeleteMapDrive(sDriveLetter)
	SET objExec = objShell.Exec("%comspec% /c net use " & sDriveLetter & " /delete /y")
	WHILE objExec.Status <> WshFinished
		'Wait for the command to be run completely 
	WEND 
	strResult = objExec.StdOut.ReadAll
End Function
 
Function MapDriveLetter(sDriveLetter, sPath)
	If sDriveLetter = "Q:" Then
		sCMD = "net use " & sDriveLetter & " " & sPath & " " & "????? /PERSISTENT:NO /USER:?????"
	Elseif sDriveLetter = "X:" Then
		sCMD = "net use " & sDriveLetter & " " & sPath & " " & "????? /PERSISTENT:NO /USER:?????"
	Else
		sCMD = "net use " & sDriveLetter & " " & sPath & " " & sRemPassWord & " /PERSISTENT:NO /USER:" & sRemUser
	End If
    sCMD = "%comspec% /c " & sCMD
 	'SET objExec = objShell.Exec("%comspec% /c " & sCMD)
	SET objExec = objShell.Exec(sCMD)
	'MsgBox("Dos Cmd: " & sCMD)
	WHILE objExec.Status <> WshFinished
		'Wait for the command to be run completely 
	WEND 
	strResult = objExec.StdOut.ReadAll
	'MsgBox("Map Response: " & strResult)
End Function
[+][-]06/30/09 12:35 PM, ID: 24748732

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Development, Web Development, Scripting Languages
Tags: Wscript
Sign Up Now!
Solution Provided By: DanRollins
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20091028-EE-VQP-87 - Hierarchy / EE_QW_3_20080625