|
[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.
Your Input Matters 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! |
||
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
|
Advertisement
| Hall of Fame |