Advertisement

08.29.2008 at 12:57PM PDT, ID: 23689979
[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.6

vbscript won't run correctly under local system logon script

Asked by TheCleaner in VB Script

Tags: , , ,

The following script works just fine when run in Windows under an account with admin privileges.  However, the same script fails to register the .ocx files using REGSVR32 when I put this vbscript in a GPO for a computer login script.  It does copy the files during the first part of the script, but it won't register the .ocx files after that.

What's strange is the exact same REGSVR32 commands when put in a .bat file and put as a computer login script work just fine.  But I really don't want to have two separate logon scripts just for this.

Any help is appreciated, I'm lost at this point.

Start Free Trial
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:
CopyFile "\\tuldc01\EOneActiveXapplets\jdeexpimpU\jdeexpimp.inf", "c:\windows\", "True"
CopyFile "\\tuldc01\EOneActiveXapplets\jdeexpimpU\jdeexpimpU.ocx", "c:\windows\", "True"
CopyFile "\\tuldc01\EOneActiveXapplets\jdewebctlsU\jdewebctls.inf", "c:\windows\", "True"
CopyFile "\\tuldc01\EOneActiveXapplets\jdewebctlsU\jdewebctlsU.ocx", "c:\windows\", "True"
RunCmd "C:\windows\system32\RegSvr32 c:\windows\jdeexpimpU.ocx /s"
RunCmd "C:\windows\system32\RegSvr32 c:\windows\jdewebctlsU.ocx /s"
 
Sub CopyFile(SourceFile, DestinationFolder, Overwrite)
	'Copy File. Note that Copy File will fail if destination has the read-only attribute set, regardless of the value of overwrite.
	Dim fso
	Set fso = CreateObject("Scripting.FileSystemObject")
	If fso.FileExists(SourceFile) Then
		If Right(DestinationFolder, 1) <> "\" Then DestinationFolder = DestinationFolder & "\"
		On Error Resume Next
		fso.CopyFile SourceFile, DestinationFolder, Overwrite
		If Err.Number <> 0 Then WScript.Echo "Can not copy file """ & SourceFile & """ to folder """ & DestinationFolder& """." & _
			Chr(13) & Chr(10) & "Reason: " & Err.Description & "."
	Else
		WScript.Echo "Can not copy file """ & SourceFile & """ to folder """ & DestinationFolder& """." & _
			Chr(13) & Chr(10) & "Reason: Source """ & SourceFile & """ not found."
	End If
	Set fso = Nothing
End Sub
 
Sub RunCmd(Command)
	'Runs a specified command.
	Dim objShell
	Set objShell = WScript.CreateObject("WScript.Shell")
	objShell.Run Command
	Set objShell = Nothing
End Sub
[+][-]08.29.2008 at 01:11PM PDT, ID: 22348868

View this solution now by starting your 7-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

Zone: VB Script
Tags: Microsoft, Windows XP, Sp2, vbscript logon script
Sign Up Now!
Solution Provided By: merowinger
Participating Experts: 2
Solution Grade: B
 
 
[+][-]08.29.2008 at 01:35PM PDT, ID: 22349065

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.03.2008 at 11:34AM PDT, ID: 22380355

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.03.2008 at 01:14PM PDT, ID: 22381466

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.03.2008 at 01:30PM PDT, ID: 22381629

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.03.2008 at 02:36PM PDT, ID: 22382249

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628