Jelikož moc neumím s visual basicem, tak bych potřeboval pomoc dostal jsem skript k opravě chyby, která zapříčiňuje zpomalení serveru. Nevím si s tím rady. jedná se se o aplikace kterou když uživatel zavře tak se automaticky odhlásí od serveru.
zde je skript Děkuji za pomoc. :D
On Error Resume Next
Set fs = CreateObject ("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject ("WScript.Shell")
'Get the username and profile directory
MUser = WshShell.ExpandEnvironmentStrings ("%USERNAME%")
MUserProfile = wshShell.ExpandEnvironmentStrings("%USERPROFILE%")
'Delete icons
fs.DeleteFolder MUserProfile & "\Start Menu\Programs\Accessories",True
fs.DeleteFile MUserProfile & "\Start Menu\Programs\*.lnk"
'Run the app
wshShell.Run "C:\POHODA_SQL\Pohoda.exe"
' Connect to wmi
set objWMIService = GetObject("winmgmts:root\cimv2")
Do
slpeep 1000
found = false
' List the processes
strQuery = "Select * from win32_process where name='Pohoda.exe'"
set colProcesses = objWMIService.ExecQuery(strQuery)
for each proc in colProcesses
' Get the reference class linking processes to sessions to get the session object path
strQuery = "References of {win32_process.handle='" & proc.handle & "'} where ResultClass=Win32_SessionProcess"
set colSessionReferences = objWMIService.ExecQuery(strQuery)
for each oSessionReference in colSessionReferences
'Get associators of the session object that are user accounts (linked by win32_loggedonuser)
strQuery = "Associators of {" & oSessionReference.antecedent & "} where AssocClass=win32_LoggedOnUser"
set colUsers = objWMIService.ExecQuery(strQuery,,48)
for each user in colUsers
if user.name = MUser then found = true
next
next
next
Loop While found = true
'Run the Windows 2003 logoff utility
wshShell.Run "c:\windows\system32\logoff.exe"