‘vbscript ‘list computers to check in com,puters.txt in same directory script is run from ‘will write server uptime to uptime.txt in same directory rfile = “computers.txt” wfile = “Uptime.txt” on error resume next Const ForReading = 1 Const ForWriting = 2 Const ForAppending = 8 Set objFSO = CreateObject(“Scripting.FileSystemObject”) Set r = objFSO.OpenTextFile(rfile, ForReading, True) […]
Problem:When accessing domain shares from a non domain member w7 x64 box we were experiencing very slow prompt for credentials (1-2 minutes) Resolution:run the following from an elevated command prompt and the change should be instantnetsh interface tcp set global autotuninglevel=disablednetsh interface tcp set global rss=disabled
‘vbscriptOption ExplicitDim oFS : Set oFS = CreateObject(“Scripting.FileSystemObject”)Function FolderEmpty(strFolderPathName) Dim oFiles, oFile, oFolder, oSubFolders, oSubFolder Dim blnFileFound : blnFileFound = False Set oFolder = oFS.GetFolder(strFolderPathName) Set oFiles = oFolder.Files If oFiles.Count > 0 Then FolderEmpty = False Exit Function End If Set oSubFolders = oFolder.SubFolders For Each oSubFolder In oSubFolders If Not FolderEmpty(oSubFolder.Path) Then FolderEmpty = False Exit Function End If Next FolderEmpty = TrueEnd FunctionDim strFolderPathName1 : strFolderPathName1 = “file://server/c$/folder“If […]
‘vbscriptconst HKEY_LOCAL_MACHINE = &H80000002 Dim oReg, strKeyPath, strValueName, strDisabled, objArgs, strComputer, arrComputersSet objArgs = WScript.Arguments arrComputers = Array(“server1″,”server2”) sOutput = “Logons Enabled(0) or Disabled(1)” & VBCRLF & VBCRLFFor EACH strComputer in arrComputers Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & strComputer & “rootdefault:StdRegProv”) strKeyPath = “SoftwareMicrosoftWindows NTCurrentVersionWinlogon” strValueName = “WinStationsDisabled” oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strDisabled sOutput = sOutput & strcomputer & ” ” & […]
‘vbscript – operates like a multimedia keyboards mute keySet WshShell = CreateObject(“WScript.Shell”)WshShell.SendKeys(chr(&hAD))
‘vbscriptOption ExplicitDim WSHShellDim objNTInfoDim GetComputerNameDim xmlConst MetaFrameWinSrvObject = 6Set objNTInfo = CreateObject(“WinNTSystemInfo”)GetComputerName = lcase(objNTInfo.ComputerName)Set WSHShell = WScript.CreateObject(“WScript.Shell”)Set xml=CreateObject(“MetaframeCOM.Metaframeserver”)xml.initialize MetaFrameWinSrvObject,GetComputerName‘xml.initialize MetaFrameWinSrvObject,”servername”xml.WinServerObject.TrustXMLRequests = 1WScript.Quit
REM Hide Altiris icons from system tray‘vbscriptConst HKEY_LOCAL_MACHINE = &H80000002strComputer = “.”Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & _ strComputer & “rootdefault:StdRegProv”)objReg.SetDwordValue HKEY_LOCAL_MACHINE,”SOFTWAREAltirisClient Service”,”ShowTrayIcon”,0
‘vbscriptConst HKEY_CURRENT_USER = &H80000001strComputer = “.”Set objReg = GetObject(“winmgmts:\” & strComputer & “rootdefault:StdRegProv”) objReg.SetDWORDValue HKEY_CURRENT_USER,”SoftwareMicrosoftWindowsCurrentVersionInternet Settings”,”ProxyEnable”,1objReg.SetStringValue HKEY_CURRENT_USER,”SoftwareMicrosoftWindowsCurrentVersionInternet Settings”,”ProxyServer”,”proxy:port”objReg.SetStringValue HKEY_CURRENT_USER,”SoftwareMicrosoftWindowsCurrentVersionInternet Settings”,”strValue “, “<local>”objReg.SetDWORDValue HKEY_CURRENT_USER,”SoftwareMicrosoftWindowsCurrentVersionInternet Settings”,”EnableAutodial”,0
‘vbscriptConst HKEY_LOCAL_MACHINE = &H80000002strComputer = “.”Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & _ strComputer & “rootdefault:StdRegProv”) objReg.SetDwordValue HKEY_LOCAL_MACHINE,”SOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem”,”EnableLUA”,1