"Internal Error 2738" due to corrupt vbscript dll?
I'm trying to install a small program just released by Microsoft. Everytime i
get "Internal Error 2738" after setup starts. The installer log gives this
reason: "DEBUG: Error 2738: Could not access VBScript runtime for custom
action". Can anyone say more? No one else seems to have this problem
installing the app, so i think it must be on my machine alone. How do i check
access or run a reinstall of the "vbscript runtime"? Is that a .dll that's
somehow corrupted? Tag: SMS componets Tag: 203250
Looping...
I am looking for a way to pause a LOOP long enough to display the results
before moving on to the next go around. In the immediate window I can see
the results are there, just happening to fast to see results in form. Tag: SMS componets Tag: 203249
OBD Explorer
HTA application , logic in VBScript
Make OBD acquisition from car with mobydic interface. Works in debug mode
without the interface ;)
Environnemetn : Internet Explorer in HTA mode, VBScript and REALTERM a
terminal software
It 's an exemple of data acquistion over serial protocol in VBScript
Using ActiveX/COM , WSH for disk access, XML for saving results SVG for
display it
http://perso.orange.fr/promethee60/data/technos/obd/OBDExplorer.html
IE is Great !! Tag: SMS componets Tag: 203248
connecting to NON-Microsoft LDAP
I'm trying to connect to a NON-Microsoft LDAP server.
Has anyone been able to connect to a NON-Microsoft LDAP coding in
vbscript and using ADSI?
I sure do appreciate your response to this. Tag: SMS componets Tag: 203247
Where to start with vbscript?
Hi all,
I've been given a small fairly trivial project to automatically
perform some operations on a spreadsheet like calculate days from
dates and create charts. I've figured vbscript is a good option, I've
seen code snippets that can get me most of what I need, but I'm
wondering where there is say an API or some sort of users guid that
will provide me with the info I need when I come across problems.
Thanks
Lionel. Tag: SMS componets Tag: 203246
Script Editor
Does anyone know of a VB Script Editor/Debugger that is similar to
VBSEdit? I purchased VBSEdit and it crashed. I can't get their tech
people to respond to emails and I'm ready to move on to something else. Tag: SMS componets Tag: 203239
read user name and group from one text file.
I have to remove different users and groups reading one file. I know how to
do it with one but not both user and group.
Can someone help me Tag: SMS componets Tag: 203236
ipaddress
How can I grab just the first three oectets of a ipaddress? Regualar
expression...(/\d+\.\d+\.\d+\./)
For example,
10.116.189.34
after running a script I need to only have the following:
10.116.189. Tag: SMS componets Tag: 203234
Location-based Startup Script
I would like to run a script at startup (and afeter hibernation) that
checked my location, based on the network connection I get. From that,
I would like to establish some defaults, like default printer.
I don't know much about initiating this type of script, how to
evaluate my network connection, and how to control default devices. If
someone can point mem toward some tutorial-like info, I would
appreciate it.
Thanks, Tag: SMS componets Tag: 203224
read from excel sheet
OK I have to remove about 300 users from different groups.
Column A would have the different user names and column B would have the
different groups than I have to write the results to a txt file ot another
excel file. Tag: SMS componets Tag: 203221
VBScript and VB6 COM object type mismatch...
Hi, Folks!
I am trying to use a to use a COM object written in VB6.
Set oSCNTool2 = CreateObject("SomeCompanyName.Tool2")
This COM object has a property called "xml" where it expects, you
guessed it, an XML string. Well, it turns out it's just expecting a
plain string and not any special XML node or what-have-you. The
problem is when I try to assign a string to this property I get a Type
Mismatch error.
oSCNTool2.xml = szXMLdata 'type mismatch error
The problem is VBScript deals in Variants and VBS strings are of the
Variant String subtype. This "xml" property is expecting the VB6
String variable type and not a Variant subtype. I do not have access
to the source code of the COM object to change it.
Does anyone know how to work around this issue?
TIA... Tag: SMS componets Tag: 203218
Detect a scheduled script timed out.
I have a vbscript scheduled task that has the scheduled task timeout
set to 2 hours. How can I make the script aware that it is about to be
terminated? Is there a script event I can use to do this? Tag: SMS componets Tag: 203216
browseforfolder to find file
This code:
Set oShell = CreateObject("Shell.Application")
set oFolder = oShell.BrowseForFolder(0,"Select poem",BIF_BROWSEINCLUDEFILES
+ 1,5)
Gives This Error
the system cannot find the file specified
Any thoughts???
Works great if I select a folder, dies if I select a file. works OK in VB6,
fails in VBScript
A Tag: SMS componets Tag: 203208
Is there a limit on WMI connections from one computer?
I have some scripts which use WMI to get system info of printers, RAM,
serial no., etc...
Right now I want to use 10 copies of each script as there are about
10,000 computers I need to scan and doing the whole lot at once would
take too long, especially if I need a report overnight. So I cut them
up into 10 scripts to run at the same time, hitting 1,000 computers
each, with all 10 scripts being identical except for the computer
names and IPs they read from an excel sheet.
The issue I'm having is that there seems to be a one session limit on
WMI, so I can't run 10 scripts on one computer. The first script runs
fine, the second I run on the same computer just quits after a few
seconds (viewing task manager I see two wscripts, then it goes to
one). Is there a way around the limit, registry hack or something?
Doing a google search got me nothing on this.
Thanks for any help. Tag: SMS componets Tag: 203207
Calling a WSH application where arguments refer to folder names that have spaces
In an HTA file I have the code shown below.
It used to run in a directory other than "My Report". The old folder
name had spaces and there were no problems.
When it runs in the "My Report" directory a message appears saying
"System can not find the file specified".
The string being sent to WSH.Run is:
C:\My%20Folder\script.vbs "C:\My Report\a.txt" "C:\My Report\b.txt"
Changing the string to
C:\My%20Folder\script.vbs ""C:\My Report\a.txt"" "C:\My Report\b.txt""
and
"C:\My%20Folder\script.vbs "C:\My Report\a.txt" "C:\My Report\b.txt" "
and
"C:\My%20Folder\script.vbs ""C:\My Report\a.txt"" ""C:\My Report
\b.txt"" "
and other permutations didn't work.
What do I need to do? Thanks.
<script language="VBScript">
Function CreateReport
File1 = "C:\My Report\a.txt"
File2 = "C:\My Report\b.txt"
Set WSH = CreateObject("WScript.Shell")
WSH.Run GetPath(document.location.pathname) & "my.vbs" & _
Chr(34) & File1 & Chr(34) & " " & _
Chr(34) & File2 & Chr(34)
Window.Close
End Function
Function GetPath(Path)
ix=InstrRev(Path,"\")
Path=Left(Path,ix)
GetPath = Path
End Function
</script> Tag: SMS componets Tag: 203198
Moving through files in a directory
I am a newbie to VBScript, so any help is appreciated. I am trying to
move files from one location to another. I would like to look at each
file and check to see if that file is already in the destination
location. If it is in that location I would like to echo out the file
name.
Is there a way I can create an Object and go through the files one by
one? Would I try to move them all first and if I get an error
message, echo out the files and keep moving on?
Here is what I have so far, but this is a crude way of accomplishing
the task.
'MoveFSO.vbs
'Moves files from the jump drive to network shares
Option Explicit
Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "F:\class3\*.wmf" , "O:\WWW\" , OverwriteExisting
objFSO.CopyFile "F:\class3\*.jpg" , "O:\WWW\" , OverwriteExisting
objFSO.CopyFile "F:\class2\*.wmf" , "N:\WWW\" , OverwriteExisting
objFSO.CopyFile "F:\class2\*.jpg" , "N:\WWW\" , OverwriteExisting
Const DeleteReadOnly = True
objFSO.DeleteFile("F:\class3\*.wmf"), DeleteReadOnly
objFSO.DeleteFile("F:\class3\*.jpg"), DeleteReadOnly
objFSO.DeleteFile("F:\class2\*.wmf"), DeleteReadOnly
objFSO.DeleteFile("F:\class2\*.jpg"), DeleteReadOnly Tag: SMS componets Tag: 203197
Moving through files in a directory
I am a newbie to VBScript, so any help is appreciated. I am trying to
move files from one location to another. I would like to look at each
file and check to see if that file is already in the destination
location. If it is in that location I would like to echo out the file
name and the file.
Is there a way I can create an Object and go through the files one by
one?
Here is what I have so far, but this is a crude way of accomplishing
the task.
'MoveFSO.vbs
'Moves files from the jump drive to network shares
Option Explicit
Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "F:\class3\*.wmf" , "O:\WWW\" , OverwriteExisting
objFSO.CopyFile "F:\class3\*.jpg" , "O:\WWW\" , OverwriteExisting
objFSO.CopyFile "F:\class2\*.wmf" , "N:\WWW\" , OverwriteExisting
objFSO.CopyFile "F:\class2\*.jpg" , "N:\WWW\" , OverwriteExisting
Const DeleteReadOnly = True
objFSO.DeleteFile("F:\class3\*.wmf"), DeleteReadOnly
objFSO.DeleteFile("F:\class3\*.jpg"), DeleteReadOnly
objFSO.DeleteFile("F:\class2\*.wmf"), DeleteReadOnly
objFSO.DeleteFile("F:\class2\*.jpg"), DeleteReadOnly Tag: SMS componets Tag: 203196
WMI for Querying "Obtain DNS Server Address Automatically"
Does WMI provide any way to query whether "Obtain DNS Server Address
Automatically" is set for a NIC?
I know that you can set the value in WMI by calling SetDNSServerSearchOrder
with no parameters. So you might think that you could just query
DNSServerSearchOrder and get back something empty or null if "Obtain DNS
Server Address Automatically" is set. But actually, DNSServerSearchOrder
returns the DNS addresses that are currently assigned, so you can't tell if
they were automatically assigned or manually assigned.
Thanks for any help.
--
Joseph Morales Tag: SMS componets Tag: 203194
Event Log Query
I've created a script that does the following:
*All output goes to a text file*
Searches through AD finding computer objects running a Server OS(using
wildcards).
Determines the disk space free on each physical drive for each machine
found.
For each machine found searches through the System and Application Log
for all error entries in the past 8 days.
Here is the script(it's not the prettiest and I know there are better
ways/methods but here it is):
Option Explicit
Dim objFSA
Dim objLogFile
Dim objFSO
Dim objLogItem
Dim objFSF
Dim objFinalLog
Dim objFSU
Dim objLog
Const ForWriting = 2
Set objFSU = CreateObject("Scripting.FileSystemObject")
Set objLog = objFSU.CreateTextFile("C:\deletefiles.vbs")
Set objFSA = CreateObject("Scripting.FileSystemObject")
Set objLogFile = objFSA.CreateTextFile("C:\tmpSrvAvail.txt")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLogItem = objFSO.CreateTextFile("C:\tmpAllSrv.txt")
Set objFSF = CreateObject("Scripting.FileSystemObject")
Set objFinalLog = objFSF.CreateTextFile("MasterFile.txt")
objLog.Write "Set objFSL = CreateObject(" & chr(34) &
"Scripting.FileSystemObject" & chr(34) & ")"
objLog.Write vbCrlf
objLog.Write "strScript = " & chr(34) & "C:\tmpAllSrv.txt" & chr(34)
objLog.Write vbCrlf
objLog.Write "objFSL.DeleteFile(strScript)"
objLog.Write vbCrlf
objLog.Write "Set objFSM = CreateObject(" & chr(34) &
"Scripting.FileSystemObject" & chr(34) & ")"
objLog.Write vbCrlf
objLog.Write "Set objFSN = CreateObject(" & chr(34) &
"Scripting.FileSystemObject" & chr(34) & ")"
objLog.Write vbCrlf
objLog.Write "strScript = " & chr(34) & "C:\tmpSrvAvail.txt" & chr(34)
objLog.Write vbCrlf
objLog.Write "objFSL.DeleteFile(strScript)"
objLog.Write vbCrlf
objLog.Write "strScript = Wscript.ScriptFullName"
objLog.Write vbCrlf
objLog.Write "objFSN.DeleteFile(strScript)"
objFinalLog.Write "All Servers in Active Directory"
objFinalLog.Write vbCrlf
Const ADS_SCOPE_SUBTREE = 2
Dim objConnection
Dim objCommand
Dim objRecordSet
Dim strDomain
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
strDomain = "DC=dms,DC=local"
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = _
"SELECT Name FROM 'LDAP://" & strDomain & "' WHERE
objectClass='computer' " & _
"and operatingSystem = '*Server*'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
objLogItem.Write objRecordSet.Fields("Name").Value
objLogItem.Write vbCrLf
objFinalLog.Write vbCrlf
objFinalLog.Write objRecordSet.Fields("Name").Value
objRecordSet.MoveNext
Loop
objFinalLog.Write vbCrlf
objFinalLog.Write vbCrlf
objFinalLog.Write "FREE DISK SPACE"
objFinalLog.Write vbCrlf
objFinalLog.Write vbCrlf
Dim g_strHostFile
Dim objFse
Dim objTextStream
Dim objWMIService
Dim colDisks
Dim g_strComputer
Dim objDisk
Const FOR_READING = 1
g_strHostFile = "C:\tmpAllSrv.txt"
Set objFse = CreateObject("Scripting.FileSystemObject")
If objFse.FileExists(g_strHostFile) then
Set objTextStream = objFse.OpenTextFile(g_strHostFile, FOR_READING)
Else
WScript.Echo "Computer list, " & g_strHostFile & " not found."
WScript.Quit
End If
Do Until objTextStream.AtEndOfStream
g_strComputer = objTextStream.ReadLine
On Error Resume Next
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & g_strComputer & "\root
\cimv2")
Set colDisks = objWMIService.ExecQuery _
("Select * from Win32_LogicalDisk Where DriveType = 3")
If Err = 0 Then
objLogFile.Write g_strComputer
objLogFile.Write vbCrLf
End If
Dim intFreeSpace
Dim intTotalSpace
Dim pctFreeSpace
Dim intTotalGB
Dim intFree
For Each objDisk in colDisks
intFreeSpace = objDisk.FreeSpace
intTotalSpace = objDisk.Size
pctFreeSpace = intFreeSpace / intTotalSpace
If Err <> 0 Then
objFinalLog.Write g_strComputer & " is offline, please check
manually."
objFinalLog.Write vbCrLf
objFinalLog.Write vbCrLf
Exit For
End If
intTotalGB = intTotalSpace/ 1024/ 1024/ 1024
intTotalGB = FormatNumber(intTotalGB, 1) & "GB"
If intFreeSpace < 1073741824 Then
intFree = objDisk.FreeSpace/ 1024/ 1024
Else
intFree = objDisk.FreeSpace/ 1024/ 1024/ 1024
End If
If intFreeSpace < 1073741824 Then
intFree = FormatNumber(intFree, 1) & "MB"
Else
intFree = FormatNumber(intFree, 1) & "GB"
End If
objFinalLog.Write g_strComputer & " "
objFinalLog.Write objDisk.DeviceID & " "
objFinalLog.Write intFree & " Free "
objFinalLog.Write intTotalGB & " Total "
objFinalLog.Write FormatPercent(pctFreeSpace) & " Percent Free"
objFinalLog.Write vbCrLf
objFinalLog.Write vbCrLf
Next
Loop
objTextStream.Close
Dim dtmStartDate
Dim DateToCheck
Dim colLoggedEvents
Dim objEvent
g_strHostFile = "C:\tmpSrvAvail.txt"
Set objFse = CreateObject("Scripting.FileSystemObject")
If ObjFse.FileExists(g_strHostFile) Then
Set objTextStream = objFse.OpenTextFile(g_strHostFile, FOR_READING)
Else
WScript.Echo "Computer list, " & g_strHostFile & " not found."
WScript.Quit
End If
Const CONVERT_TO_LOCAL_TIME = True
Set dtmStartDate = CreateObject("WbemScripting.SWbemDateTime")
DateToCheck = CDate(Date())
dtmStartDate.SetVarDate DateToCheck - 8, CONVERT_TO_LOCAL_TIME
Do Until objTextStream.AtEndOfStream
g_strComputer = objTextStream.ReadLine
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & g_strComputer & "\root
\cimv2")
Set colLoggedEvents = objWMIService.ExecQuery ("Select * From
Win32_NTLogEvent Where LogFile = 'System' AND TimeWritten >= '" &
dtmStartDate & "' AND EventType = 1")
If Err = 0 Then
objFinalLog.Write "Error Events from System Log."
objFinalLog.Write vbCrLf
End If
For Each objEvent in colLoggedEvents
If Err <> 0 Then
Exit For
End If
objFinalLog.Write g_strComputer
objFinalLog.Write vbCrLf
objFinalLog.Write "Category: " & objEvent.Category
objFinalLog.Write vbCrLf
objFinalLog.Write "Event Code: " & objEvent.EventCode
objFinalLog.Write vbCrLf
objFinalLog.Write "Message: " & objEvent.Message
objFinalLog.Write vbCrLf
objFinalLog.Write "Record Number: " & objEvent.RecordNumber
objFinalLog.Write vbCrLf
objFinalLog.Write "Source Name: " & objEvent.SourceName
objFinalLog.Write vbCrLf
objFinalLog.Write "Event Type: " & objEvent.EventType
objFinalLog.Write vbCrLf
objFinalLog.Write "Time Written: " & objEvent.TimeWritten
objFinalLog.Write vbCrLf
objFinalLog.Write vbCrLf
Next
Loop
objTextStream.Close
objFinalLog.Write VBCrLf
objFinalLog.Write VBCrLf
objFinalLog.Write "Error Events from Application Log."
g_strHostFile = "C:\tmpSrvAvail.txt"
Set objFse = CreateObject("Scripting.FileSystemObject")
If objFse.FileExists(g_strHostFile) Then
Set objTextStream = objFse.OpenTextFile(g_strHostFile, FOR_READING)
Else
WScript.Echo "Computer list, " & g_strHostFile & " not found."
WScript.Quit
End If
Set dtmStartDate = CreateObject("WbemScripting.SWbemDateTime")
DateToCheck = CDate(Date())
dtmStartDate.SetVarDate DateToCheck - 8, CONVERT_TO_LOCAL_TIME
Do Until objTextStream.AtEndOfStream
g_strComputer = objTextStream.ReadLine
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & g_strComputer & "\root
\cimv2")
Set colLoggedEvents = objWMIService.ExecQuery ("Select * From
Win32_NTLogEvent Where LogFile = 'Application' AND TimeWritten >= '" &
dtmStartDate & "' AND EventType = 1")
For Each objEvent in colLoggedEvents
If Err <> 0 Then
Wscript.Echo "We made it here." & g_strComputer
Exit For
End If
objFinalLog.Write vbCrLf
objFinalLog.Write g_strComputer
objFinalLog.Write vbCrLf
objFinalLog.Write "Category: " & objEvent.Category
objFinalLog.Write vbCrLf
objFinalLog.Write "Event Code: " & objEvent.EventCode
objFinalLog.Write vbCrLf
objFinalLog.Write "Message: " & objEvent.Message
objFinalLog.Write vbCrLf
objFinalLog.Write "Record Number: " & objEvent.RecordNumber
objFinalLog.Write vbCrLf
objFinalLog.Write "Source Name: " & objEvent.SourceName
objFinalLog.Write "Event Type: " & objEvent.EventType
objFinalLog.Write vbCrLf
objFinalLog.Write "Time Written: " & objEvent.TimeWritten
objFinalLog.Write vbCrLf
objFinalLog.Write vbCrLf
Next
Loop
objTextStream.Close
Wscript.Echo "Job Completed, check Master File for Output."
On Error GoTo 0
Dim objShell
Dim strDelete
Set objShell = CreateObject("Wscript.Shell")
strDelete = "C:\deletefiles.vbs"
objShell.Run(strDelete)
I was having problems deleting the files I create earlier in the
script, hence the reason my script creates another one, which deletes
the files and itself.
My problem is that I need to run this is in multiple domains, for
different clients. I do not believe this script will work correctly in
a mixed environment ie running 2003 and 2000 Server OS's, which some
of our clients have.
Can someone advise me on how to get this to work in a mixed
environment? Short of running a search on the 2000 machines, then
another on the 2003 machines. Thanks. Tag: SMS componets Tag: 203193
Finding multiple memgers of a group
Hi,
I am working on a script that will determin if three different ID's
are in the local Administrators group on a long list of servers. I can
get my script to reliably report on ONE user, but If I try fro more
than one, I get mixed results and I can't trust the accuracy. Can
someone point me to a sample script or discussion on finding multiple
users in a group?
This script will tell me if JoeUser is a memger of the Administrators
group on a list of servers.
Option Explicit
Dim objGroup, strComputer, objFSO, objTextFile
Const ForReading = 1
On Error Resume Next
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("C:\Scripts\servers.txt",
ForReading)
Do Until objTextFile.AtEndOfStream
strComputer = Trim(objTextFile.Readline)
If (strComputer <> "") Then
Set objGroup = GetObject("WinNT://" & strComputer & "/
Administrators,group")
Wscript.Echo "Members of local Administrators group on computer " &
strComputer
Call EnumGroup(objGroup, "")
End If
Loop
Sub EnumGroup(objGroup, strOffset)
Dim objMember
For Each objMember In objGroup.Members
'Wscript.Echo strOffset & objMember.Name & " (" &
objMember.Class & ")"
If (objMember.Name = "JoeUser") Then
Wscript.Echo strOffset & objMember.Name & " (" &
objMember.Class & ")"
End If
Next
End Sub Tag: SMS componets Tag: 203192
need help creating a VBS for an Excel file.
I have an Excel file with a few worksheets in it. One of those worksheets
contains data that is linked to a TXT file and another is linked to another
Excel file.
When I open the file it prompts to "Enable Automatic Refresh". I click yes,
then I get two more prompts - one for each of the links mentioned above.
Here's what I'm looking to do:
I want a script that will open that file and automatically respond (in the
affirmative) to those 3 prompts. I then want the file saved and copied into
another location - so that when the user opens it, it is more or less
"stale" data - in otherwords, it doesn't give them the option to
automatically refresh.
Is this possible? How? Help!
Thanks!
Glenn Tag: SMS componets Tag: 203188
CDO.ReplyTo Method?
Is there a CDO.ReplyTo Method? I would like the email to be From a
NAME but I need to include an email address for them to reply to.
For instance, I do not want it to show up as FROM: email@domain.com
but rather FROM: NAME and then have them able to reply to the email.
Thanks. Tag: SMS componets Tag: 203185
Interfacing with Exchange Address Contact List
Hi,
I have written a VBScript that takes a tab delimited file of
customer's contact information and loads it into a users contact list,
and loads into distribution lists by state. This works great. The
user runs the script, chooses the file's location, and it runs while
their outlook is open.
This is great except that it needs to be run relatively often as our
customer base grows. Is it possible to schedule a VBScript to run at
night that will run against a file and add it to specific user's
contact list? Currently, Outlook must be open and it connects to the
running account. Can i write something that does this without the
user needing to be logged in?
Thanks very much for your help. Tag: SMS componets Tag: 203181
How to refresh the start menu?
Is there a way to script a refresh of the start menu (including Windows XP
and newer)? Iâ??m using start menu redirection and when my file share (where
the shortcuts are located) goes down and up again, I can refresh my desktop
(which is also redirected) to get my shortcuts back, but for the start menu I
have to kill and restart the explorer process, which isnâ??t the nicest way.
Surely there must be a way to refresh the start menu in another way? Tag: SMS componets Tag: 203178
0x80041001 accessing WMI from script
Hello all,
I am trying to use a vbs script that changes alert resolution state in
MOM2005 SP1 using WMI ROOT\MOM, class MSFT_Alert. Script is here:
http://msdn2.microsoft.com/en-us/library/ms812714.aspx
For some object instances when I use command "Call objAlert.Put_" I got
error "SWbemObjectEx: Generic failure". Also when I am trying to change
resolution state value and save the object using wbemtest utility it shows me
more error data: "Number: 0x80041001, Facility: WMI, Description: Generic
failure".
For some object instances script works ok
WMIDiag from
http://www.microsoft.com/downloads/details.aspx?familyid=d7ba3cd6-18d1-4d05-b11e-4c64192ae97d&displaylang=en
says that "SUCCESS: WMIDiag determined that WMI works CORRECTLY".
I tried to update only part of an instance, but it still fails:
http://msdn2.microsoft.com/en-us/library/aa393949.aspx
Related link:
http://www.mombu.com/microsoft/mom-sdk/t-set-alert-resolution-state-put-method-fails-with-error-generic-failure-205225.html
What this error means and how to resolve the issue?
Mazhas Tag: SMS componets Tag: 203176
Screen Refresh
Im having a hard time getting a hta application to update the screen
while processing.
>From what i have read i should be using settimeout but i can not work
out how. I must be just a dunce. The vbscript file just does a
wscript.sleep for 5 seconds while i troubleshoot this issue.
Any help will be greatfully received.
gui-report.hta
<html>
<link type="text/css" href="gui-report.css" rel="stylesheet" />
<head>
<title>GUI-Report</title>
<HTA:APPLICATION
ID="objHTAGUI-Report"
APPLICATIONNAME="HTAGUI-Report"
SCROLL="no"
SINGLEINSTANCE="yes"
WINDOWSTATE="normal"
>
<OBJECT width="0" height="0" classid="clsid:
550dda30-0541-11d2-9ca9-0060b0ec3d39" id="complist" VIEWASTEXT="">
</OBJECT>
<body onload="Initialize();" onunload="Cleanup();" class="MainBody">
<script language="vbscript">
Dim fs, sh
Const sCmdString = "cscript /nologo test.vbs "
Const MaxForks = 1 'starts from zero (ie, 0 = one fork, 5 = six forks)
Const MaxRunTime = 15 ' Seconds
'wshExec
Const WshRunning = 0
Const WshFinished = 1
Sub Initialize()
Dim xmlDoc
Set xmlDoc = complist.XMLDocument
Const THESETTINGS = "C:\work\xmlreport\test.xml"
Set fs = CreateObject("Scripting.FileSystemObject")
Set sh = CreateObject("Wscript.Shell")
xmlDoc.Async=False
if fs.FileExists(THESETTINGS) Then
xmlDoc.load THESETTINGS
Else
xmlDoc.loadxml ("<?xml version=""1.0"" encoding=""utf-8"" ?
><computerlist><computer><Name>BLANK NAME</Name><Status></
Status><Reboot>0</Reboot><Enabled>-1</Enabled></computer></
computerlist>")
End If
End Sub
Sub Window_Onload
End Sub
Sub ChangePointer
If window.event.srcElement.id = "notesbuttonrun" Then
notesbuttonrun.style.cursor="hand"
ElseIf window.event.srcElement.id = "notesbutton" Then
notesbutton.style.cursor="hand"
End If
End Sub
Sub OK_OnClick
Dim xmlDoc
Set xmlDoc = complist.XMLDocument
xmlDoc.save "test.xml"
SetStatus "Saved!"
End Sub
Sub Load_OnClick
Dim fso, oFile, sHTML, sFilename, rc
Dim sLine, aLine
Dim xmlDoc, sXML
Set FSO = CreateObject("Scripting.FileSystemObject")
sFilename = FileName.Value
'on error Resume Next
Dim iLine
If FSO.FileExists(sFilename) Then
Set xmlDoc = complist.XMLDocument
Set oFile = FSO.OpenTextFile(sFilename)
sXML = "<?xml version=""1.0"" encoding=""utf-8"" ?><computerlist>"
Do Until oFile.AtEndOfStream
iLine = iLine + 1
SetStatus "Loading Line: " & iLine
sLine = oFile.ReadLine
aLine = Split(sLine, vbTab)
If Len(aLine(0)) > 0 Then
sXML = sXML & vbNewLine & "<computer><Name>" & aLine(0) & "</
Name><Status></Status><Reboot>0</Reboot><Enabled>-1</Enabled></
computer>"
End If
'
' If isArray(aLine) Then
' Else
' sXML = sXML & vbNewLine & "<name>" & TypeName(aLine) & "</
Name><Status></Status><Reboot>0</Reboot><Enabled>0</Enabled>"
' End If
Loop
oFile.Close
sXML = sXML & vbNewLine & "</computerlist>"
rc = xmlDoc.loadxml (sXML)
SetStatus "Loaded file: " & RC
Else
SetStatus "File Not Found"
End If
End Sub
Sub SetStatus(sMsg)
code.InnerHTML = "<textarea cols=100 rows=1>" & sMsg & "</textarea>"
End Sub
Sub cancel_OnClick
TheStatus.Value = "Cancel"
End Sub
Dim aThreadInfo
Dim iVal
Sub CheckBool()
SetStatus Now()
window.clearTimeout iVal
MsgBox "HH"
' iVal = window.setTimeout("CheckBool()", 100)
End Sub
Sub Process_OnClick
Call ProcessTest()
End Sub
Sub ProcessTest
Dim xmlDoc, xmlList, xmlComp
SetStatus "Processing"
Set xmlDoc = complist.XMLDocument
Set xmlList= xmlDoc.SelectNodes("computerlist/computer")
SetStatus TypeName(xmlList)
Redim aThreadInfo(MaxForks, 2)
Dim i
For i = 0 To UBound( aThreadInfo, 1)
Set aThreadInfo(i,0) = Nothing ' wshExec
aThreadInfo(i,1) = 0 ' Time
Set aThreadInfo(i,2) = Nothing ' xmlComp
Next
Dim xmlStatus, sEnabled, sCompName
' sEnabled = xmlComp.SelectSingleNode("Enabled").text
' If cBool(sEnabled) Then
' Else
' Set xmlStatus = xmlComp.SelectSingleNode("Status")
' xmlStatus.Text = "Disabled"
' End If
Dim iThread
For Each xmlComp in xmlList
iVal = window.setTimeout("CheckBool()", 100)
Set xmlStatus = xmlComp.SelectSingleNode("Status")
SetStatus "Processing: " & xmlComp.SelectSingleNode("Name").text
sCompName = xmlComp.SelectSingleNode("Name").text
xmlStatus.text = sCompName
sCommand = sCmdString & " /Workstation:" & sCompName
iThread = -1
Do until iThread <> -1
iThread = GetNextThread()
SetStatus "GetNextThread = -1"
' wscript.Sleep 100
Loop
Set aThreadInfo(iThread,0) = sh.exec(sCommand)
aThreadInfo(iThread,1) = Now()
Set aThreadInfo(iThread,2) = xmlComp
Do Until ProcessCheck()
' wscript.sleep 200
Loop
Next
Do Until ProcessCount()=0
'call ProcessCheck ()
Loop
End Sub
Dim idTimer
Sub PausedSection()
idTimer = window.setTimeout("PausedSection", 2000, "VBScript")
End Sub
Function GetNextThread ( )
Dim i
GetNextThread = -1
For i = 0 to UBound( aThreadInfo, 1)
If aThreadInfo( i, 1) = 0 then
GetNextThread = i
SetStatus "GetNextThread" & i
Exit Function
End if
Next
End Function
Function ProcessCount()
Dim i, t
call ProcessCheck ()
t=0
For i = 0 to UBound(aThreadInfo)
If NOT isNothing(aThreadInfo(i,0)) Then
t=t+1
End If
Next
ProcessCount=t
SetStatus "ProcessCount" & ProcessCount
End Function
Function ProcessFinished()
Dim i
ProcessFinished = True
'wscript.sleep 100
For i = 0 to UBound(aThreadInfo)
If NOT isNothing(aThreadInfo(i,0)) Then
ProcessFinished = False
End If
Next
End Function
Function ProcessCheck()
Dim i, stdOut
ProcessCheck = False
'wscript.sleep 100
For i = 0 to UBound(aThreadInfo)
If isNothing(aThreadInfo(i,0)) Then 'Check those objects that are
running
ProcessCheck = True
Else
If aThreadInfo(i, 0).Status = WshRunning Then
UpdateXMLStatus aThreadInfo(i, 2), Now() - aThreadInfo(i, 1)
' If Now-aThreadInfo(i,1) > MaxRunTime Then
' Call ProcessStdIO(aThreadInfo(i, 2), "Thread took longer than
MaxRunTime")
' DebugPrint "Terminating thread " & i & " and processid " &
aThreadInfo(i,0).ProcessID
' DebugPrint "Terminating thread Started:" & aThreadInfo(i,1)
' 'aThreadInfo(i,0).Terminate
' Run ".\kill.exe " & aThreadInfo(i,0).ProcessID
' wScript.Sleep 1000
' Set aThreadInfo(i,0) = Nothing
' aThreadInfo(i,1) = 0
' aThreadInfo(i,2) = vbNullString
' End If
Else
stdOut = vbNullString
stdOut = aThreadInfo(i, 0).StdOut.ReadAll
UpdateXMLStatus aThreadInfo(i, 2), "Completed"
'ProcessStdIO (aThreadInfo(i, 2), aThreadInfo(i,
0).StdOut.ReadLine)
aThreadInfo(i, 1) = 0
Set aThreadInfo(i, 0) = Nothing
Set aThreadInfo(i, 2) = Nothing
ProcessCheck = True
End If
End if
Next
End Function
Function isNothing(oTemp)
If TypeName(oTemp)="Nothing" Then isNothing = TRUE
End Function
Function UpdateXMLStatus(oXML, sStatus)
Dim xmlStatus
Set xmlStatus = oXML.SelectSingleNode("Status")
xmlStatus.Text = sStatus
End Function
Function ProcessCompThread (xmlComp)
End Function
</script>
<title>Gui Report Title</title>
</head>
<body>
<table border="0" width="100%">
<tr>
<td width="50%">FileName:<input type="file" value="FileName"
name="FileName" size="40"> <input type="button" value="Load"
name="Load" class="button"></td>
<td width="50%"><input type="button" value="Process"
name="Process" class="button" size=50></td>
</tr>
<tr>
<td width="50%">
<input type="button" value="OK" name="OK" class="button"><input
type="button" value="Cancel" name="Cancel" class="button"></td>
<td width="50%">ReportDir:<input type="text" value="ReportDir"
name="ReportDir" size="50"></td>
</tr>
<tr>
<td width="100%" colspan="2">
<div id="InsertBuildSelect"></div>
<table cellspacing="1" cellpadding="2" id="actionheader"
width="100%">
<tbody>
<tr>
<th width="300">Computer Name</th>
<th width="250">Status</th>
<th width="50">Enabled</th>
<th width="50">Reboot</th>
<th>output</th>
</tr>
</tbody>
</table>
<DIV STYLE="overflow: auto; width: 100%; height: 550; padding:0px;
margin: 0px">
<table datasrc="#complist" width="100%" cellspacing="1"
cellpadding="2" id="actionlist">
<tbody>
<tr>
<td width="300"><span datafld="Name"></span></td>
<td width="250"><span datafld="Status"></span></td>
<td width="50"><input type="checkbox" datafld="Enabled"
style="width:12; height:12" /></td>
<td><input type="checkbox" datafld="Reboot" style="width:12;
height:12" /></td>
</tr>
</tbody>
</table>
</DIV>
<table>
<td width="100%" colspan="2">
<div ID=code_header></div>
<div id="code"></div>
</td>
</table>
</div>
</td>
</tr>
</table>
<input type="hidden" name="TheStatus" size="20">
</body>
</html>
test.xml
<?xml version="1.0" encoding="utf-8"?>
<computerlist>
<computer><Name>ADMIN</Name><Status></Status><Reboot>0</
Reboot><Enabled>0</Enabled></computer>
<computer><Name>ADMIN1</Name><Status></Status><Reboot>0</
Reboot><Enabled>0</Enabled></computer>
<computer><Name>ADMIN2</Name><Status></Status><Reboot>0</
Reboot><Enabled>0</Enabled></computer>
</computerlist> Tag: SMS componets Tag: 203173
Sort multi-dimensional array using vb.net
Hi all,
I have a recordset (result after executing a SQL query) containing names of
employees and their information. The [EmployeeName] column is in unicode.
Due to limition of sorting unicode results in T-SQL, I would like to dump
the recordset in an array and sort them according to the [EmployeeName].
Sample data will be as follows:
[EmployeeNo]......[EmployeeName]......[Dept]......[Title]
193......Peter......Finance.....Manager
632......Amy......Marketing......(blank)
8765......Chris......Marketing......Clerk
87......John......HR......(blank)
I guess the data should be put in an array (arr(no.ofRecords,4))similar to
the one below:
arr(0,0) = 193
arr(0,1) = Peter
arr(0,2) = Finance
arr(0,3) = Manager
arr(1,0) = 632
....
I find it impossible to use the "sort" method in vb.net because it deals
with 1-dimensional array only. May I know how to sort the above data in vb
.net (2003) so I can have the [EmployeeName] in ascending order? I will need
to display the rest of the information as well.
Thanks very much. Tag: SMS componets Tag: 203172
Need Some Help
I have created a script to force the replication on one of our DFS servers.
Set wmi = GetObject("winmgmts:\\" & strcomputer & "\Root\MicrosoftDfs")
Set query = wmi.execquery("Select * from DfsrConnectionInfo where
partnername = 'FAOSFPS-HO01'")
For Each item In query
item.forcereplication()
Next
i am getting SWbemObjectEx: Invalid parameter when i call the method
forcereplication.
I don't know what parameters to use or what i am doing wrong Tag: SMS componets Tag: 203168
Using InStr to find $$
I need to find the existence of two dollar signs in a string. I tried
the InStr command but could not make it work:
barcode = "whatever$$asdfa"
twodollarsigns = "$$"
If InStr(barcode,twodollarsigns)=0 Then
MsgBox "there is missing data"
It works with other characters, not the $$. Any ideas on how I can do
this?
Thanks
DG Tag: SMS componets Tag: 203158
external vbscript file
I've programmed in VB in Windows for years but new to web dev and
VBScript...
I'm trying to write a popup balloon to display when user hovers or
clicks a link...
The text will be data returned from a SQL query. That function works
works but I'm trying to put it in an external vbs file.
I have my vbs file KJVQuery.vbs with the function that returns a <p>
tag with the recordset data:
Function GetKJVBibleVerse (sBook, sChapter, sVerse)
....
End Function
In my calling ASP I;m just trying to test the call with this:
<script type="text/vbscript" src="KJVQuery.vbs" language="vbscript"></
script>
<% response.write( GetKJVBibleVerse ("Mark", "003", "'001' AND
'012'")) %>
When I run I get this:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'GetKJVBibleVerse'
/test3.asp, line 13
PS - anyone know where I can find some code already written with a
nice popup that will disappear when it loses focus - not when user
clicks close button?
Thanks...Tom Tag: SMS componets Tag: 203154
initialize input value
Trying to initialize an input text box with a date. I thought using <
% Date %> in value would do it...
<input name="iDate" type="text" maxlength="50" value="<%Date%>">
Thanks... Tag: SMS componets Tag: 203151
Open URL links and save page
Hi,
I'm looking to see if it is possible to create a script that can open a list
of links (url's) one by one is fine and save that page?
Is this possible?
Thanks,
Sanj Tag: SMS componets Tag: 203149
I need to check Folder and make sure it is empty.
I have 4 folders that are used all night and populated with text files. In
the morning, the files have all been processed and the foldrs are ( or
should be) empty. Occasionally text files get left behind.
I need to modify an existing VBScript to check and make sure each folder is
empty before allowing operator to continue with script's operation.
Psuedocode:
'Check Folder1 Is Folder empty?
If Folder is empty, then
'procede with next step,
ELSE
'display message box "Text Files have been left unprocessed in Folder1.
Move and process files, and empty Folder1, then restart this
script."VBCRLF,"This program will now end". '(The vbscript will end and no
further action taken if files still exist.)
END IF
I can handle the actions to take, but I don't know the best way to determine
if a folder is empty or if any files exist. The filenames would be multiple
and various. Tag: SMS componets Tag: 203138
Power Management
I currently have about 500 portables that I need to modify the power scheme
on. They are defaultly set to the "Laptop/Portable" Scheme. It is causing
multiple problems in my environment. I need to change the scheme to "Always
On" but making these changes require modification to the below keys of the
registry. And non-admin users don't have permissions to change them.
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ControlsFolder\PowerCfg
HKU\.DEFAULT\Control Panel\PowerCfg
HKCU\Control Panel\PowerCfg
I have created scripts that modify the HKCU and can apply it as a login
script but I need to modify the machine and .default.
Thanks in advance,
James Tag: SMS componets Tag: 203114
Call a vbscript file from a dos batch file?
Can I call a vbscript from a dos batch file?
I am creating Windows 2000 and XP unattended installations.
The way I have things set up is that I boot the subject computer from a dos
based network boot disk.
First the user is given the option to choose the Student or Teacher domain.
Then the user is given the option to install either XP or 2000.
I'd also like the user to be able to enter whatever the end computer's name
should be (as a variable I guess).
Then a vbscript residing on the appropriate server would be called.
That script would read what the computers name is supposed to be, delete an
existing account in Active Directory if it exists, and then create the
computer account.
Is this possible?
Thanks,
Jeremy Tag: SMS componets Tag: 203111
Need Help with file deployment script
I have struggled mightily with this, but it is well beyond my fairly
pathetic coding abilities. If someone could please help it would be
greatly appreciated.
What I have is a program that runs scripts or other executables every
5 seconds.
The program will not run the script if there is already 1 instance
running, so no worries about multiple instances.
What I want is a script that when run, will check C:\Deploy
If any files exist in the folder it will move them to C:\Backup
\YYYYMMDDHHMMSS
It will deploy copies of those files to a list of network destinations
\\MM00156\C:\deploy for example
Under normal circumstances, 3 folders will be dropped into C:\Deploy
There will be any number of files within those folders, and those
folder names will be static
I need to copy ONLY certain files from within those folders to the
network destinations
preferably from a list such as
C:\Backup\20070221155536\Config\Dbapi.pcs
C:\Backup\20070221155536\Junk\Config.ini
etc etc etc
The files when delivered to the network locations will always be
overwriting old files, so would need some sort of overwrite without
confirm setting or something.
My thinking was that the list could be an array populated from an ini
file (I suck at arrays), or could just be listed within the script
itself, the list of filenames would never change, so it doesn't really
matter.
I got as far as being able to create the backup folder, but am really
struggling with how to make it not create a backup folder every 5
seconds, and how to copy only the files in my list.
Option Explicit
Dim N, objFSO, objFolder
Dim strDirectory
N = Now
strDirectory = "C:\Backup\" & ((((Year(N)*100 + Month(N))*100 +
Day(N))*100 + Hour(N))*100 + Minute(N))*100 + Second(N)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.CreateFolder(strDirectory)
Permissions would already be set on all folders to allow the necessary
operations, so no issues there.
Anyway, I'd really like some help on this one if possible
Thank you SO much in advance.
Jason Tag: SMS componets Tag: 203100
Script to remove and create directories
would some assist me in creating a vbs script file to do the following
commands:
del /q "c:\Documents and Settings\%username%\cookies\*.*"
del /q "c:\Documents and Settings\%username%\Local Settings\Temp\*.*"
del /q "c:\Documents and Settings\%username%\Templates\*.*"
del /s /a:h /q "c:\Documents and Settings\%username%\*.tmp"
del /q "c:\Documents and Settings\%username%\Templates\*.*"
rmdir /s /q "c:\Documents and Settings\%username%\Local Settings
\Temporary Internet Files"
rmdir /s /q "c:\Documents and Settings\%username%\Local Settings\Temp"
i'm trying to use a .vbs file rather than a .bat file for this process
for my users to clear out data from the above locations.
thank you in advance,
don Tag: SMS componets Tag: 203098
Script to Delete Internet Cache Files?
I am looking for a way to delete the internet cache files via a script,
without deleting cookies. I have a website which is being upgraded, and the
new version crashes due to old internet cache files that are not refreshed
properly.
Deleting the cache files corrects the problem, but I want to avoid having
each user do this when they access the app after the upgrade, as it will
generate a lot of calls for our help desk.
IE is already configured to check for new files on every visit to the page,
but this is not working in this case.
We could simply delete the contents of everyone's temporary internet files,
but this would remove their cookies and all their favorite settings would be
lost. This would upset some users, and politically be a bad move, so it is
not really an option.
I was hoping there would be some way to script this so we could delete all
of the cache files, excluding offline content and cookies, just like you do
from the Tools, Internet Options, Delete Files.
Does anyone know of a way to do this? Tag: SMS componets Tag: 203097
ActiveD
I have a logon script that is assigned to all my users through and
Active Directory Group Policy that attempts to setup a network drive
mapping. If the drive letter is already mapped to another path it
removes the mapping first using RemoveNetworkDrive. It then creates
the new mapping using MapNetworkDrive. If the correct mapping already
exists the script does nothing.
At the end of the script I loop through the emumerated drives to
verify that the mapping exists and it does, but
My problem is that for most users the drive mapping seems to vanish as
soon as the script ends.
Any ideas why? The script, with some of my debugging still there
follows.
' MapDrives.vbs
' Removes any existing mapping for the K drive and maps
' it to \\denali\Academics
' ------------------------------------------------------'
Option Explicit
Dim strDriveLetter, strRemotePath
Dim objNetwork, objShell
Dim CheckDrive, RemoveConnection, NotAlreadyConnected, intDrive
' The section sets the variables.
strDriveLetter = "K:"
strRemotePath = "\\denali\Academics"
'Create shell and network objects
Set objShell = CreateObject("WScript.Shell")
Set objNetwork = CreateObject("WScript.Network")
' Get network drive count
Set CheckDrive = objNetwork.EnumNetworkDrives()
' Loop throuh drives and determine if drive letter exists
On Error Resume Next
RemoveConnection = False
NotAlreadyConnected = True
For intDrive = 0 To CheckDrive.Count - 1 Step 2
If CheckDrive.Item(intDrive) = strDriveLetter then
If CheckDrive.Item(intDrive + 1) = strRemotePath then
NotAlreadyConnected = False
Else
RemoveConnection = True
End If
End If
Next
' If RemoveConnection then remove the existing network drive
If RemoveConnection = True then
objNetwork.RemoveNetworkDrive strDriveLetter, "True", "True"
End if
' If NotAlreadyConnected then map the network drive
If NotAlreadyConnected = True then
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
' WScript.Echo "Mapped " & strDriveLetter & " to " & strRemotePath
End If
' Get network drive count
Set CheckDrive = objNetwork.EnumNetworkDrives()
For intDrive = 0 To CheckDrive.Count - 1 Step 2
If CheckDrive.Item(intDrive) = strDriveLetter then
If CheckDrive.Item(intDrive + 1) = strRemotePath then
WScript.Echo "MapDrives: " & strDriveLetter & " is mapped to " &
strRemotePath
End If
End If
Next
WScript.Quit
'End of MapDrives Tag: SMS componets Tag: 203093
VBScript/Regex Question
Greetings,
Example Code:
-----------------------------------------------
testString = "<div>Hi there, what's new?</div>"
objRegEx.Pattern = "<div>(.*)</div>"
objRegEx.Global = true
objRegEx.IgnoreCase = true
str = objRegEx.Replace(testString, "The results are: $1")
----------------------------------------------
Unless I have something wrong, it appears that $1 is only "returned"
by VBScript. In other words, I can't put it into a variable or call
functions on it. I need to put the value of $1 into a javascript
variable and need to escape all of the single quotes, backslashes,
newlines, etc. Is there any way I can change the last line to:
str = objRegEx.Replace(testString, "The results are:" & replace("$1",
"\", "\\'")
and also have it work?
Help appreciated!
DRN Tag: SMS componets Tag: 203087
Appending a text file
Hi, Everyone
I am trying to move log files from one server to another.
the Log files are text files. I am checking that if the file exists in
destination folder than I am appending the text file to the same text
file in destination folder.But, If the file does not exists in
Destination Folder than I move that file from source folder to
destination folder.
Thanks, Tag: SMS componets Tag: 203086
Appending a text file
Hi, Everyone
I am trying to move log files from one server to another.
the Log files are text files. I am checking that if the file exists in
destination folder than I am appending the text file to the same text
file in destination folder.But, If the file does not exists in
Destination Folder than I move that file from source folder to
destination folder.
Thanks, Tag: SMS componets Tag: 203085
Appending a text file
Hi, Everyone
I am trying to move log files from one server to another.
the Log files are text files. I am checking that if the file exists in
destination folder than I am appending the text file to the same text
file in destination folder.But, If the file does not exists in
Destination Folder than I move that file from source folder to
destination folder.
Thanks, Tag: SMS componets Tag: 203084
NOOB QUESTION: How to overwrite specific data in a .csv?
Okay, I've got another one for you vets to boost your egos on:
Say I have a .csv file that has the following columns:
Date Serial Number Location
I want to take a variable, compare it to what's in the "Serial Number"
column and, if it matches, overwrite all three values. (or delete
them and append the new values, which ever is easier)
I can open and read and compare the information just fine.. but vb
wont allow both read/write access to a file, so how do I achieve this?
Can someone draw up a simple example? Tag: SMS componets Tag: 203079
Creating a directory structure
Please forgive my being a novice on the subject of scripting. I have
no previous history with any type of coding (except a little HTML).
I'm not looking for the solution. I wouldn't ask that of anyone
(unless you really want to give it to me). I've been a part of help
forums before and I hate it when people have no desire to actually do
it themselves.
What I am looking for is perhaps a good resource to begin researching
the solution. What steps should I be looking to take?
Here's what needs to be accomplished:
The script needs to read a file (I'm not sure if it's an excel
spreadsheet or a text document). In this document is a list of
items. The script will need to create a folder with the names in the
document. Then, the script needs to also create 10 subfolders with
specific names. The names of the subfolders will be the same for all
of the main folders. Within those subfolders, there'd be other
subfolders, again - identical throughout.
The file that the script reads will only provide the names of the main
folders.
Any information you can give would be greatly appreciated.
Thank you,
TriZz
PS: I think my boss has me a bit over my head here. Tag: SMS componets Tag: 203075
script to determine java install and version
Hi All,
I am trying to find a script to tell on a number of computers if java
is installed and is what version. We are trying to determine what dst
patched we need to apply for java.
I know I can run java -version remotely but how do I get the response
back from that to a file/log.
Thanks
Mike Tag: SMS componets Tag: 203074
Creating variable on the fly in HTA
Hi.
I have an HTA which include a span id created on the fly (e.g. <span
id="span" & id & "Status">Bla</span>)
I would like to change the InnerHTML on that span but am having
problems creating the variable on the fly. For example I have tried:
strA = "1" <--equivalant to id in the span
span&strA&Status.InnerHTML = "Blabla"
But that doesn't work. I've also tried
strA = "1" <--equivalant to id in the span
strB = "span" & strA & "Status"
strB.InnerHTML = "Blabla"
And that doesn't work either. Can anyone help me or provide any
suggestions on how I might do this?
Thanks! Tag: SMS componets Tag: 203070
English equivenent of VBS Factory
is the an English equivalent of this
http://www.astase.com/produits/vbsfactory/?PHPSESSID=3b5c2340886018bdcf2249a04dc807ad
cheers Tag: SMS componets Tag: 203065
Question about WQL statement
Hello All
I want to get some information about the AntiVirus program installed on the
machine, using WMI. By using wmic and the following command line options, I
can get what I expect:
wmic /NAMESPACE:\\root\SecutiyCenter PATH AntiVirusProduct GET ALL
In my WMI client application, I want to use the equivalent WQL statement.
What is the equivalent WQL statement?
Best Regards
Ali Majdzadeh Tag: SMS componets Tag: 203061
Are there any components for VBScript that will allow me to send an sms
message?