I like consolidation, but when I do that it seems to have a "Type Mismatch" error on the :
Set objFileAgent = objFSOAgent.OpenTextFile("c:\textfile.txt", 1)
Hello All!
I am working on a HTA file that will parse thru a text file then output the last 5 or 6 lines of the text file to a Textbox. The script runs but only outputs 1 of the 5 readouts on the screen. I'm stuck. Please help!
<head>
<HTA:APPLICATION
APPLICATIONNAME="HPSA Utility...
...strServiceName = "SomeService"
Set colServiceList = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = colServiceList.ExecQuery("Select * from Win32_Service where name = '" & strServiceName & "'",,48)
If (Err.Number = 0) And IsObject(colServiceList) Then
If colServiceList.Count > 0 Then...
I believe I am experiencing the same issue. What account are you running the script on the remote machine as? If it is the system account you probably cannot enumerate Domain information with that account.
Why not assign the the command a variable? Something like...
strCommand = objShell.Run ("cmd /c S:\update1.cmd",1,True)
Set objExecObject = objShell.Exec(strCommand)
Set objStdOut = objWshScriptExec.StdOut
Do Until objStdOut.AtEndOfStream
strLine = objStdOut.ReadLine
Wscript.Echo...
I don't know if this will help you if you are trying to do a single nic like I am.
http://www.jsifaq.com/SF/Tips/Tip.aspx?id=4705
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1079491&SiteID=1
This portion (below) seems to be skiping to "Unable to replace DNS..." Any ideas on this?
intSetDNSServers = objNicConfig.SetDNSServerSearchOrder(arrNewDNSServerSearchOrder)
If intSetDNSServers = 0 Then
WScript.Echo " Replaced DNS server search order list."
Else
WScript.Echo "...
...like this? I don't think the quotes are correct because it doesn't seem to grab any NIC's.
Set colNicConfigs = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionID = 'NIC One'",,48)
NICIndex = objItem.Index
Set colNicConfigs = objWMIService.ExecQuery _...
..._
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colNicConfigs = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE NetconnectionID = 'NIC One'")
For Each objNicConfig In colNicConfigs
strDNSHostName = objNicConfig.DNSHostName...
...strComputers, INPUT_FILE_NAME
Dim ObjShell
Dim strCurrentLine
Dim FileFSO,objFile
Dim objRegEx
Dim IP_Address, colMatches
On Error Resume Next
'*********************************************************************************
Set ObjShell = CreateObject("WScript.Shell")
'Executes HPONCFG.exe...
I used this script a while back. Not sure if it will help you.
Set objOU = GetObject ("LDAP:// OU=<OU>,OU=<OU>,DC=<DC>")
objOU.Filter = Array ("Computer")
For Each ObjComputer In objOU
strName = objComputer.Name
strlen = len(strName)
size = strlen -3
strComputerName = Mid(strName, 4...
I have made the corrections. The script works....as is. My issue is modifying it so that it will read multiple files of the same file type within a given folder on multiple computers. As you can see it already loops throught multiple computers. I just don't know where to start for reading...
...Dim pFolderName : pFolderName = "computers.txt"
Dim intIndex
Dim strMatch2
Dim objpath
Dim strComputer
Dim AbsoluteRelative
Const ForReading = 1
'*********************************************************************************
INPUT_FILE_NAME = Inputbox("Type in the location of the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.