[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.

Question
[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!

8.2

Remote Execute Kix script

Asked by dakeys in VB Script, Network Management, Network Operations

Tags: script, kix, vb

Heya;

Here is what Im trying to do: I trying to add a registry key if it does not exist.
I want to run the kix script against a txt file.

NTDOC from kixtart once helped me out with something like this, but it was for an SQL DSN entry, I figured I could just modify some of the values and it would work,

Come to find out it's not working.
Here is the script that I'm using, trying to see if someone can assist me

Thanks

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:
Break On
Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('NoMacrosInStrings','On')
 
Global $WinPath,$Computers
Dim $Ping,$sComputer
 
$Computers = ReadFile(@ScriptDir+'\'+'computers.txt')
For Each $sComputer In $Computers
If $sComputer
$sComputer = Trim($sComputer)
$Ping = OSPing($sComputer)
If $Ping
$WinPath = WindowsInstallFolder($sComputer)
$sComputer=IIf(Not $sComputer,'','\\'+Join(Split($sComputer,'\'),'',3)+'\')
If InStr(ReadValue($sComputer+'HKLM\SOFTWARE\VB and VBA Program Settings\CPTS51\Paths','Data_Path'),'\\Servername\SharedDrive\Program Files\CoumaCare 5.1')
'No update Required on ' + $sComputer ?
Else
CreateDSN($sComputer)
'Update key on: ' + $sComputer + ' - ' +@ERROR + ' - ' + @SERROR ?
EndIf
Else
'The computer ' + $sComputer + ' did not repsond to ping' ?
EndIf
EndIf
Next
 
Function CreateDSN($sComputer)
Dim $Key,$Set
$Key = 'HKLM\SOFTWARE\VB and VBA Program Settings\CPTS51'
$Set=WriteValue ($sComputer+$Key+'\Paths','Data_Path','\\Servername\shareddrive\Program Files\Application',Reg_SZ)
Exit @ERROR
EndFunction
 
Function ReadFile($file)
Dim $lf, $f, $_, $t
$lf=CHR(10)
$f=FreeFileHandle
$_=Open($f,$file)
If @ERROR Exit @ERROR EndIf
Do $t=$t+$lf+ReadLine($f) Until @ERROR
$_=Close($f)
$ReadFile=Split(SubStr($t,2),$lf)
EndFunction
 
Function WindowsInstallFolder(optional $sComputer,$UNC)
Dim $WinDir
$sComputer=IIf(Not $sComputer,'','\\'+Join(Split($sComputer,'\'),'',3)+'\')
If $sComputer And $UNC
$WinDir = $sComputer+Join(Split(ReadValue($sComputer+'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion','SystemRoot'),':'),'$')
Else
$WinDir = ReadValue($sComputer+'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion','SystemRoot')
EndIf
If @ERROR
$WindowsInstallFolder = ''
Exit Val('&' + Right(DecToHex(@ERROR), 4))
Else
$WindowsInstallFolder = $WinDir
EndIf
Exit @ERROR
EndFunction
 
Function OSPing($sComputer)
Shell'%comspec% /c ping -n 1 '+$sComputer+' >nul'
$OSPing = NOT @ERROR
EndFunction
[+][-]09/20/09 07:22 AM, ID: 25377327Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/21/09 08:52 AM, ID: 25384218Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/21/09 08:52 AM, ID: 25384223Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/21/09 07:51 PM, ID: 25389267Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/09 05:27 AM, ID: 25671586Accepted Solution

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: VB Script, Network Management, Network Operations
Tags: script, kix, vb
Sign Up Now!
Solution Provided By: dakeys
Participating Experts: 1
Solution Grade: A
 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625