Editing extended Active Directory user's informations with VBScrip
Since with VBScript we are limited to input one field at a time using the
inputbox function, I'm trying to write down something that will open an IE
form where I will get multiple extended user's information:
- employeeNumber
- preferredLanguage
- division
I found some samples, but I'm always getting a lot of errors trying to make
them works, actually my VBScript looks like this (initially get from a MVP):
Function ExtendedInfo()
set oSH = CreateObject("Wscript.Shell")
set oIE = CreateObject("InternetExplorer.Application")
With oIE
.RegisterAsDropTarget = False
.FullScreen = True
.width = 400 : .height = 200
.Navigate "about:blank"
Do Until .ReadyState = 4 : WScript.Sleep 100 : Loop
.document.open
.document.write _
"<html><head><" & "script>bboxwait=true;</" _
& "script><title>User's Extended Informations</title></head>"_
& "<body bgColor=Silver scroll=no language=vbs" _
& " onkeypress='if window.event.keycode=13 Then" _
& " bboxwait=false'><center>" _
& "<b> Enter user's extended informations<b> <p>" _
& "<table><tr><td> <b>Employee #:</b></td><td>" _
& "<input type=text id=emp value='" & strEmpNumber & "'>" _
& "<button onclick='bboxwait=false;'> Ok </button>" _
& "<button onclick='bboxwait=cancel;'> Cancel </button>" _
& "</center></body></html>"
.document.close
Do Until .ReadyState = 4 : WScript.Sleep 100 : Loop
With .document
oIE.left = .parentWindow.screen.width \ 2 - 200
oIE.top = .parentWindow.screen.height\ 2 - 100
.body.style.borderStyle = "outset"
.body.style.borderWidth = "3px"
.all.user.focus
.all.user.select
ExtendedInfo = Array("CANCELLED")
Do While .parentWindow.bBoxWait
oSH.Appactivate "User's Extended Informations"
oIE.Visible = True
if Err Then Exit Function
WScript.Sleep 100
If .parentWindow.bBoxWait = "cancel" Then
oIE.Visible = False
MsgBox(.parentWindow.bBoxWait)
Exit Do
End If
Loop
oIE.Visible = False
ExtendedInfo = Split(.all.user.value & "|" & .all.pass.value, "|")
End With ' document
End With ' IE
end function
I just modified the function name and where the form is written (for
Employee #), and I'm always getting the following error message:
Object doesn't support this property or method: 'all.user'
and the referred line is .all.user.focus
What's wrong with my VBScript???
Thanks.
Claude Lachapelle
Systems Administrator, MCSE Tag: Verifying IIS certificates Tag: 219410
More job id's in wsf file
Is there any way to call the individual job id's in a main job in a
wsf file .
See example below, I want to call job GetBuild and InstallBuild in job
id "Main". Is it possible and what is the syntax.
<?XML Version="1.0"?>
<?job Error="true" Debug="true"?>
<package>
<job id="Main">
<script language="VBScript">
<![CDATA[
Call JOBID GetBuild
Call JOBID InstallBuild
]]>
</script>
</job>
<job id="GetBuild">
<script language="VBScript" src="Functions.vbs"/>
<script language="VBScript" src="GetBuild.vbs"/>
<script language="VBScript">
<![CDATA[
Set oshell = CreateObject("wscript.shell")
Set ofs = CreateObject("Scripting.FileSystemObject")
Call Function
]]>
</script>
</job>
<job id="InstallBuild">
<script language="VBScript" src="Functions.vbs"/>
<script language="VBScript" src="InstallBuild.vbs"/>
<script language="VBScript">
<![CDATA[
Set oshell = CreateObject("wscript.shell")
Set ofs = CreateObject("Scripting.FileSystemObject")
Call Function
]]>
</script>
</job>
</package>
Regards,
Gert Jan Tag: Verifying IIS certificates Tag: 219408
key and subkey
Is there any way to delete a key with subkeys under it with a vbscript?
From what I have tried you have to delete all the subkeys first before you
can delete the key.
exp:
To delete the key ddeexec I have to delete the Topic and the Application
keys first before I can delete the ddeexec key. Any way around this?
WshShell.RegDelete
"HKEY_CLASSES_ROOT\FirefoxHTML\shell\open\ddeexec\Application\"
WshShell.RegDelete "HKEY_CLASSES_ROOT\FirefoxHTML\shell\open\ddeexec\Topic\"
WshShell.RegDelete "HKEY_CLASSES_ROOT\FirefoxHTML\shell\open\ddeexec\" Tag: Verifying IIS certificates Tag: 219381
Embedded HTA
To give VBSCript an Interface you use an hta
Using CreateObject (in Visual Basic for instance) is it possible to
embed a HTA - like you can with a Webbrowser Object - or is HTA not the
way to do this
I want to script on the machine from within an application with a web
browser like rendering (and maintain control of the object) Tag: Verifying IIS certificates Tag: 219376
populating two dimensional array with excel data
Hi,
I'm looking for an efficient way to populate a two dimensional array. The
first cell of each row contains the First Name and the second cell has the
Last Name. I'm ok up to the part where I actually need to read the data in
The code I have for reading the data into the array works but it is just
awful:
'loop reading each spreadsheet element into the array
n = 0 'counter for array element position
intRow = 1
intCol = 1
Do Until objExcel.Cells(intRow,intCol).Value = ""
Fullname(n,0) = objExcel.Cells(intRow, intCol).Value
intRow = intRow + 1
n = n + 1
Loop
intRow = 1
intCol = 2
n = 0
Do Until objExcel.Cells(intRow,intCol).Value = ""
Fullname(n,1) = objExcel.Cells(intRow, intCol).Value
intRow = intRow + 1
n = n + 1
Loop
There has to be a better way. Can someone show me?
Thanks in Advance Tag: Verifying IIS certificates Tag: 219372
Dynamic Radio button in HTA will not selecting.
My option buttons are not working! When I click on one of them. the bullet
turns grey momentarily but does not stick. I just can't figure out why! Can
someone help me!
The purpose of this script will be to enumerate files in the current folder.
Select the files and it will eventually (not yet implemented) compare files
select.
<html>
<head>
<HTA:APPLICATION
APPLICATIONNAME="Compare Files"
SCROLL="no"
SINGLEINSTANCE="no">
<script language="VBScript">
Sub GetLogs
Dim btnCompare, objForm, i, objElement
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.Shell")
Set objFolder = objFSO.GetFolder(objShell.CurrentDirectory)
Set colFiles = objFolder.Files
Set objForm1 = Document.Forms("log1")
Set objForm2 = Document.Forms("log2")
For Each objFile in colFiles
If InStr (lcase(objFile.Name),"log") Then
Set objElement=document.createElement("input")
With objElement
.type="radio"
.value=objFile.Name
.name="file1"
End With
objForm1.appendChild objElement
Set objElement=document.createElement("input")
With objElement
.type="radio"
.value=objFile.Name
.name="file2"
End With
objForm2.appendChild objElement
Set objElement=document.createTextNode(objFile.Name)
objForm1.appendChild objElement
Set objElement=document.createTextNode(objFile.Name)
objForm2.appendChild objElement
set objElement=document.createElement("br")
objForm1.appendChild objElement
set objElement=document.createElement("br")
objForm2.appendChild objElement
'set objElement=nothing
End If
Next
End Sub
Sub CompareFiles
Dim i
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objResultFile = objFSO.OpenTextFile("comparison.txt", ForWriting,
TRUE)
objResultFile.WriteLine ("test")
For i = 0 to Document.Form.Elements.Count -1
If Document.Form.Elements(i).Name = "file1" Then
If Document.Form.Elements(i).Checked Then
strFile1 = Document.Form.Elements(i).Value
objResultFile.WriteLine = strFile1
Exit For
End if
End if
Next
For i = 0 to Document.Form.Elements.Count -1
If Document.Form.Elements(i).Name = "file2" Then
If Document.Form.Elements(i).Checked Then
strFile2 = Document.Form.Elements(i).Value
objResultFile.WriteLine = strFile1
Exit For
End if
End if
Next
End Sub
</script>
</head>
<body onload="GetLogs">
<table width="100%" border>
<tr>
<td width="50%" valign="top">
<form id="log1">
</form>
</td>
<td width="50%" valign="top">
<form id="log2">
</form>
</td>
</tr>
</table>
<input id=runbutton type="button" value="Compare Files" name="runButton"
onClick="CompareFiles"><p>
</body>
</html> Tag: Verifying IIS certificates Tag: 219367
File parsing on steroids needed - Part II
Hello all.
Many moons ago, I posted a request for help with this same type of
issue:
http://groups.google.com/group/microsoft.public.scripting.vbscript/browse_thread/thread/f1f78014008099fc/8991e865aeb0bfe6?lnk=gst&q=File+parsing+on+steroids+needed#8991e865aeb0bfe6
As always, I received excellent help on my previous post. Now I'm back
again with the same type of issue. I need to (do a complex) search and
replace text in a file.
I have a text file (it's the output of the Resource kit utility
secedit.exe) that looks something like this:
SeCreatePagefilePrivilege = *S-1-5-32-523
SeDebugPrivilege = *S-1-5-32-523
SeRemoteShutdownPrivilege = *S-1-5-32-523,*S-1-5-32-528
SeAuditPrivilege = *S-1-5-13,*S-1-5-19
SeIncreaseQuotaPrivilege =
SeIncreaseBasePriorityPrivilege = *S-1-5-32-523
SeLoadDriverPrivilege = *S-1-5-32-523
SeBatchLogonRight =
*S-1-5-19,*S-1-5-21-2113617034-347475637-2087665911-40777,SUPPORT_366945a0,IUSR_W815-
WEB228-A,IWAM_W815-WEB228-A,IIS_WPG,ASPNET
SeServiceLogonRight =
*S-1-5-20,*S-1-5-21-2113617034-347475637-2087665911-123821,ASPNET,*S-1-5-21-2250643452-2129950081-2393833302-1007,*S-1-5-21-2250643452-2129950081-2393833302-1009
SeInteractiveLogonRight = IUSR_W815-WEB228-
A,*S-1-5-32-523,*S-1-5-32-547,*S-1-5-32-530
SeSecurityPrivilege = *S-1-5-32-523
SeAssignPrimaryTokenPrivilege =
SeRestorePrivilege = *S-1-5-32-523,*S-1-5-32-528,*S-1-5-32-529
What I want to do is the following:
- find each SID in this text file
- turn that SID into a variable
- process that variable in a script that will resolve the SID to an
account name
- replace the SID in the original text file with that account name
I've got the script that will resolve the SID to an account name:
strSID = "S-1-5-32-523"
strComputer = "W815-WEB228-A"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\cimv2")
Set objAccount = objWMIService.Get("Win32_SID.SID='" & strSID & "'")
strResolvedSID = objAccount.AccountName
MsgBox strResolvedSID
Set objWMIService = nothing
Set objAccount = nothing
I just need the file parsing done to extract the SIDs.
Any help would be greatly appreciated. Thanks!
- Dave Tag: Verifying IIS certificates Tag: 219366
VBS waiting for program to finish
hello,
I have this script that I use on a servicedesk.
Basically it starts the Telnet service on a remote PC and then connects me
to it.
myans = Inputbox("Enter PC Name or IP address")
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "sc \\"& myans &" config tlntsvr start= auto"
objShell.Run "sc \\"& myans &" start TlntSvr"
objShell.Run "telnet " & myans
'objShell.Run "sc \\"& myans &" stop TlntSvr"
'WScript.Quit
Set objShell =nothing
What I want it to do is wait until the telnet program is closed my mysef
then run the following bit of code.
objShell.Run "sc \\"& myans &" stop TlntSvr"
Is that possible?
D Tag: Verifying IIS certificates Tag: 219363
View last created user accounts
Hello
Is it possible to view user accounts (mailboxes) that were created on
Exchange 2007 server last n days?
Thanks!
Regards,
Miha Tag: Verifying IIS certificates Tag: 219362
RSOP Planning Security problem
I've been trying to do some RSOP Planning using a non-admin user account on
a domain member workstation.
I am using the following VBScript code:
strComputer = "DC1"
Set locator = CreateObject("WbemScripting.SWbemLocator")
Set connection = locator.ConnectServer (strComputer, "root\rsop", null,
null, null, null, 0, null)
(for the ConnectServer parameters, see
http://msdn.microsoft.com/en-us/library/aa393720(VS.85).aspx)
When I logon to the workstation as an administrator - no problem executing
the script.
When I use a non-admin account, I get an error 80070005 access denied
message executing line 3.
I have used the wmimgmt.msc mmc to set permissions on Root\RSOP for
"Authenticated Users" to the same as "Administrators" for "this namespace
and subnamespaces".
I have also granted "Authenticated Users" permission for "RSOP Planning" and
"RSOP Logging" on the OU which contains the workstation account.
What permissions am I missing??? Tag: Verifying IIS certificates Tag: 219348
Opening a file of known path but different extension
Hi, I've made a script for running the command-line program pdflatex.
The script uses a file open dialogue for the user to choose a TeX
file, which pdflatex will convert to PDF.
After running pdflatex I would like the script to open the file in
Adobe Reader (AcroRd32 <filename>). The script knows what the
input .tex file is, and the PDF file output from pdflatex will have
the same name and path but .pdf extenstion. How can I get the string
of the input file and change the extension to .pdf to put into a run
method? I have found scripts for changing file extensions but these
all seem to use explicit paths (e.g. here:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/jun07/hey0601.mspx).
I assume I can do something with regular expressions but I'm lost as
to how to use them in this case.
Here's my script so far:
----------------------------------------------------------------------
'Create shell object
Set WshShell = WScript.CreateObject ("WSCript.shell")
StartBox
Function GetFileName( myDir, myFilter )
' This function opens a File Open Dialog and returns the
' fully qualified path of the selected file as a string.
'
' Arguments:
' myDir is the initial directory; if no directory is
' specified "My Documents" is used;
' NOTE: this default requires the WScript.Shell
' object, and works only in WSH, not in HTAs!
' myFilter is the file type filter; format "File type description|
*.ext"
' ALL arguments MUST get A value (use "" for defaults), OR otherwise
you must
' use "On Error Resume Next" to prevent error messages.
'
' Dependencies:
' Requires NUSRMGRLib (nusrmgr.cpl), available in Windows XP and
later.
' To use the default "My Documents" WScript.Shell is used, which isn't
' available in HTAs.
'
' Written by Rob van der Woude
' http://www.robvanderwoude.com
' Standard housekeeping
Dim objDialog
' Create a dialog object
Set objDialog = CreateObject( "UserAccounts.CommonDialog" )
' Check arguments and use defaults when necessary
If myDir = "" Then
' Default initial folder is "My Documents"
objDialog.InitialDir =
CreateObject( "WScript.Shell" ).SpecialFolders( "MyDocuments" )
Else
' Use the specified initial folder
objDialog.InitialDir = myDir
End If
If myFilter = "" Then
' Default file filter is "All files"
objDialog.Filter = "All files|*.*"
Else
' Use the specified file filter
objDialog.Filter = myFilter
End If
' Open the dialog and return the selected file name
If objDialog.ShowOpen Then
GetFileName = objDialog.FileName
Else
WScript.Quit
End If
End Function
Function CheckFileExists(sFileName)
'Function for checking file exists. It returns 'True' if the file
exists, or 'False' if it does not.
Dim FileSystemObject
Set FileSystemObject =
WScript.CreateObject("Scripting.FileSystemObject")
If (FileSystemObject.FileExists(sFileName)) Then
CheckFileExists = True
Else
CheckFileExists = False
End If
Set FileSystemObject = Nothing
End Function
Sub StartBox( )
'Start UI
Dim objPrnDlg, strPrompt, strTitle
Const vbOK = 1
Const vbCancel = 2
Const vbAbort = 3
Const vbRetry = 4
Const vbIgnore = 5
Const vbYes = 6
Const vbNo = 7
'Start prompt - if user chooses OK file browse dialogue is opened
strPrompt = "This will convert a TeX file to PDF." & VbCr & "Press
OK to browse for file:"
strTitle = "Pdflatex Script"
If MsgBox( strPrompt, vbOKCancel, strTitle ) = vbOK Then
'Check if pdflatex exists. If true open file dialogue and run
pdflatex on file, else give error message
'**NOTE**: Script will only work if pdflatex is in the path shown
below. Add an or statement for other possible instances
If CheckFileExists("C:\Program Files\MiKTeX 2.7\miktex\bin
\pdflatex.exe") Then
'Prompt for file selection and run pdflatex on file
WshShell.Run "pdflatex " & Chr(34) & GetFileName( "", "TeX files|
*.tex" ) & Chr(34), 1, True
set WshShell = nothing
Else
WScript.Echo("Cannot find pdflatex program. Please make sure you
have MikTex 2.7 installed.")
End If
End If
End Sub Tag: Verifying IIS certificates Tag: 219332
I need to "press any key to continue"
when I run a BAT command , it paused ,any I need to press a key to continue.
How can it run automatically because I set this BAT as a scheduled task.
Thanks!
Haoqiang Tag: Verifying IIS certificates Tag: 219328
Secret WEB CAMS at HOTELS & LODGES
HAI..........
Guys this web site s very useful to
you...........
How This site
helps..........
how to earn money form
online......
In this site, you wil earn more than 10000/- Rs per month....
its true ....... just login this site and << EARN MONEY
>>
www.freeonlinedollers.blogspot.com
www.freedollers.blogspot.com
www.moviesgossips.blogspot.com Tag: Verifying IIS certificates Tag: 219325
KERELA couples Enjoying SEX at NET CAFE
HAI..........
Guys this web site s very useful to
you...........
How This site
helps..........
how to earn money form
online......
In this site, you wil earn more than 10000/- Rs per month....
its true ....... just login this site and << EARN MONEY
>>
www.freeonlinedollers.blogspot.com
www.freedollers.blogspot.com
www.moviesgossips.blogspot.com Tag: Verifying IIS certificates Tag: 219324
Query csv and return all entries within last x days
I have a comma delimited file in the following format:
Computer Name,Time Date,Time Zone,Action
Workstation1,11/8/2007 12:03:34 PM,Central Standard Time,Executed Logon Script
Workstation1,11/8/2007 12:13:33 PM,Central Standard Time,Executed Logoff
Script
I am attempting to write a script that will parse this txt file and return
only the entire line for those entries that have occured within the last 30
days
Any assistance would be most appreciated.
Thanks in advance
Todd Starling Tag: Verifying IIS certificates Tag: 219323
Problem with DGSET GROUP report
I made a simple batch file to get a list of machines belonging to
certain groups, save it to a file then open it in Excel.
See below:
dsget group "cn=AdobeAcrobat9,ou=*,ou=Groups,ou=*,DC=*,DC=*" -members -
expand | sort > "c:\documents and settings\%username%\desktop
\spreadsheetname.xls
start excel.exe "c:\documents and settings\%username%\desktop
\spreadsheetname.xls
It works but the output is ugly with it displaying a bunch of info
about the path that to the OU that I don't need to look at, and, at
the same time, there is a bit more info I want that I can't get it to
display.
It has the following problems.
1. Excel fails to seperate the OU info into seperate cells despite
the info being seperated by commas. (I'd like to solve this comma
seperation or just not show this info).
2. I need to get the "description" field of the computers, but when I
try to add "desc" to dsget it gives the description field of the
AdobeAcrobat9 group instead the description field of each of the
members of the group.
3. I really don't need it to display all the OU info. All I'd like
it do is save a list of the machine names that belong to the
AdobeAcrobat9 group in a format Excel can display elegantly and in
alphabetical order. The description field of each of the member
computers should be displayed in the same row as the computer name.
How can this be done?
Can it be done with a simple bat file or does it have to be a vbs
script? Tag: Verifying IIS certificates Tag: 219321
quotes and variables
I am wondering if someone can clarify the proper use of the oShell.run
command at the bottom of the sample script below. I am importing a registry
file via WSH. The name of the file is in long format as indicated by the
stmpFile variable. Since the file name will be different for every user, I
want to pass the variable name instead of the file name. However the long
format is not allowing the import. I know I have to pass the quotes along
with the variable. I have tried several syntax however, none of which have
worked. Can anyone assist?
sTmpFile = "c:\Some long Name.reg"
' Write to the temporary registry file
fFile.WriteLine "Windows Registry Editor Version 5.00"
fFile.WriteLine
fFile.WriteLine
"[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\UserInfo]"
fFile.WriteLine """UserName""=hex:" & strUsernameHex
fFile.WriteLine """UserInitials""=hex:" & strInitialsHex
fFile.Close
oShell.Run "regedit /s " & sTmpFile, 0, True Tag: Verifying IIS certificates Tag: 219309
Pipe a pipe command to a file
I couldn't find any better place to post this, so here it is:
I'm trying to find a way to echo a pipe command (>>) to a file.
Basically I'm trying to have one batch file create another batch file on the
fly. Unfortunately one of the commands already has a pipe command in it:
FOR /F %%I IN ('%1') DO ECHO %%~I >>%2
So to pipe it to a batch file, I would normally do this:
echo FOR /F %%I IN ('%1') DO ECHO %%~I >>%2 >> c:\test.bat
Unfortunately this fails because there are two sets of pipe commands (>>) in
the line.
Is there a way around this, maybe a way to specify ASCII characters in place
of >>?
Thanks,
--
Bill Baker Tag: Verifying IIS certificates Tag: 219308
regular expressions to replace but keep character?
Is there a way to use Replace with Regular Expressions but keep a character
in the original string? A simplified example: If we have "< a >" or "<b >"
or "< br>" within a string and we want to remove the spaces, but keep the
character, is there a way this can be done? A Regular Expression can find
the substring with something like "<\s*[a-z]\s*>" (only finds one character),
but the ReplaceWith argument appears to be static. Is there any way to keep
the character?
Thanks!,
Nick Tag: Verifying IIS certificates Tag: 219290
error handling permissions denied
Can somebody help me with this script.
I want to check windows xp machines is the computer online or not, then the
script will check of there is some events in de eventviewer
for disk bad blocks. ( this is not the hole script )
But by some computers i have an access denied (Code Error 800A0046 -
Permission Denied ) ,
the script stopped. also with On Error Resume Next.
Is there a way that the script will run the next computer?
Thanks for help
Floyd
Here is the script :
On Error Resume Next
Const ForReading = 1
Const FOR_WRITING = 2
Const ForAppending = 8
'///// Open the input file
Dim oFSO, oTF, oShell
Set oFSO = CreateObject("scripting.filesystemobject")
Set oTF = oFSO.OpenTextFile("computers.txt",ForReading,True)
Set oShell = CreateObject("Wscript.Shell")
'///// Creer input en output file`s
Dim sLogfile : sLogFile = "output\computer_SYSTEM.log"
Dim sLogFile1 : sLogFile1 = "input\computer_NOK.txt"
Dim sLogFile2 : sLogFile2 = "input\computer_OK.txt"
Dim sLogFile3 : sLogFile3 = "input\Inventory_DiskBadBlocks.txt"
Do While oTF.AtEndOfStream <> True
IntConnectionError = 0
strComputer = oTF.ReadLine
'///// Ping computer
Dim objShell , objExec , strPingResults
Dim objWMIService , colCompSystems , objCompSystem
Set objShell = CreateObject("WScript.Shell")
Set objExec = objShell.Exec("ping -n 2 -w 1000 " & strComputer)
strPingResults = LCase(objExec.StdOut.ReadAll)
If InStr(strPingResults, "reply from") Then
WScript.Echo VbCrLf & strComputer & " is online"
Dim oLogFile1 : Set oLogFile1 = oFSO.OpenTextFile
(sLogFile2,FOR_WRITING,true)
oLogFile1.WriteLine strcomputer
Dim colItems
Set objWMIService = GetObject("winmgmts:\\" & strcomputer & "\root\CIMV2")
SqlQuery = "Select * from Win32_NTLogEvent Where Logfile ='System' AND
TimeGenerated >""" + sDate + """"
Set colItems = objWMIService.ExecQuery (SqlQuery)
Dim oLogFile3 : Set oLogFile3 = oFSO.OpenTextFile
(sLogFile3,ForAppending,true)
Dim intEvent,objEvent
intEvent = 0
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
For Each objEvent in colItems
If objEvent.EventCode = "7" Then
If objevent.sourcename = "Disk" then
intEvent = intEvent + 1
'F_WriteLogFile WMIDateStringToDate(objEvent.TimeGenerated) & "
|Bad Blocks op Cdrom of Disk " & objevent.sourcename , sLogFile
End If
End If
Next
If intEvent > 1 then
F_WriteLogFile "Event Disk Bad Blocks " & intEvent & " " &
strcomputer & " <<<<<" , sLogFile
oLogFile3.WriteLine strcomputer & " " & date & " Aantal: " &
intevent
Else
F_WriteLogFile "Event Disk Bad Blocks " & intEvent
, sLogFile
End If
WScript.Echo VbCrLf & strComputer & " is not online"
Dim oLogFile : Set oLogFile = oFSO.OpenTextFile (sLogFile1,FOR_WRITING,true)
oLogFile.WriteLine strcomputer
End If
Loop Tag: Verifying IIS certificates Tag: 219275
Rename old NT4 user accounts.
We have recently purchased another comany and I need to take their old NT4
domain and convert all the user account ids to be an employee number. This
will match our 2003 AD domain. This is the first step in migrating their
domain into ours. I have seen numerous examples on how to change the user id.
My question is: Using VB how would I query the other domain with different
credentials than what I am logged into my computer. There is no trust
between NT4 and 2003 domains. There will be over 900 accounts to change and I
really really dont want to sit in front of user manager for a weekend
changing all the accounts.
Thanks,
Don Tag: Verifying IIS certificates Tag: 219273
Is a computer On???
I need to know if a computer is running or not. Well... I know it's very
easy to make a ping, put this into a file and read if I get the "ping" or
not. I think it's the normal way...but, there is a "professional" way to do
it???
Thanks in advance :)
G. Aranda Tag: Verifying IIS certificates Tag: 219269
File Modification Dates in IExpress package
Does anyone know how to make IExpress store files with their original
modification dates?
When I create a package using IExpress, it stores the files using with a
modification date of the time the package was built. I need them stored with
their original modification dates (like most compression programs do). Is
this possible? Tag: Verifying IIS certificates Tag: 219260
your needs are more in this site,hot and sweat to your dreams,don't
your needs are more in this site,hot and sweat to your dreams,don't
miss to visit,come on guys and girls hurry up.
**************************************************************************http://
anushkahollywood.blogspot.com/
******************************************************************************************************* Tag: Verifying IIS certificates Tag: 219254
Trying to organize 3k+ folders with a script
We have a server that has over 3k folders containing scanned check
images, and they need to be organized into folders by year, then
month, then day. Not every day has images. The naming structure for
the folders is as follows:
0011117040010187
001 (Branch) | 11 (month) | 17 (day) | 04 (year) | 0010187
The folder structure we would like to use looks like this:
2004
--11 NOV
---01
---02
etc. We can do this by hand, but with so many images i thought it
might be easier to use a script. I would figure it out by myself, but
I couldn't program to save my life. I almost failed numbers and logic
in college if that tells you anything. Any help would be appreciated
though and probably useful to many people in the future :) Tag: Verifying IIS certificates Tag: 219238
800A01B6: Object doesn't support this property or method
Hey all,
I'm trying to automate and online process that we use to submit information.
I'm running into this error ONLY for ONE field and it is becoming very
frustrating...
here is the code snippet:
With IE
With .Document
With .All
.rid.Value = Wscript.Arguments.Item(0)
.dispense_date.Value = Wscript.Arguments.Item(1)
.prescriber_id.Value = Wscript.Arguments.Item(2)
.pres_date.Value = Wscript.Arguments.Item(3)
.charge.Value = Wscript.Arguments.Item(4)
.rx_number.Value = Wscript.Arguments.Item(5)
.Quantity_dispensed.Value = Wscript.Arguments.Item(7)
.newrefil.Value = Wscript.Arguments.Item(8)
.ingrcost.Value = Wscript.Arguments.Item(9)
.daysup.Value = Wscript.Arguments.Item(10)
.levelserv.Value = 3
.cde_ndc.Value = Wscript.Arguments.Item(6) <-- here is where it crashes
End With
End With
End With
Every field besides this one works and will fill in properly.
Literally EVERY field... I've tried every single possible field on the web
page... this is the only one that doesn't work
I KNOW that this is the proper name for the text field and I've tried
MULTIPLE ways to get around this issue. I also know it is, in fact, a text
field. I'm not super proficient in HTML, but as far as I can tell there is no
difference between this field and any other. The only method I can run using
this object is ".Length". I've no idea where to go from here.
Here is the HTML for that particular field:
<td><input type="text" size="15" maxlength="11" name="cde_ndc"
datafld="cde_ndc" ID="cde_ndc" style="BACKGROUND-COLOR:white"></td>
the only other line of HTML is the initializing statement and this:
<DIV datafld="cde_ndc" align="left" nowrap style="OVERFLOW-X: hidden"></DIV>
but the other fields that have this information will work
The field itself should just be an 11 digit number/string...
Any help would be much appreciated!
Thank you! Tag: Verifying IIS certificates Tag: 219235
Known bug in CStr (Date ()) in WSH 5.7?
Hi folks
I've recently updated my XP laptop to SP3 which has uplifted WSH to v5.7 and
this has introduced a bug regarding the Date () function. When the result is
being converted to a string, it doesn't use the correct local format, but
seems to default to US format instead. Here in the UK the standard format is
DD/MM/YYYY. Here is some example code:
WScript.Echo Date ()
WScript.Echo â??â?? & Date ()
WScript.Echo CStr (Date ())
Under 5.6 this produces the correct output:
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
04/07/2008
04/07/2008
04/07/2008
Under WSH 5.7 the output is:
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
04/07/2008
7/4/2008
7/4/2008
This happens in both cscript.exe and wscript.exe.
Is this a known bug? The main problem I have with it is that any WMI queries
using the date either fail or return the wrong data.
Regards
Tony Longson. Tag: Verifying IIS certificates Tag: 219234
Need help with copyhere
I'm using MS Access 2003 and am running a VBA script that will
retrieve an inventory status report from an email. The attachment in
the email is a .zip file and I'm try to replace it in a folder.
I have 2 problems:
1) The file ends up adding more sub folders;
Inventory Reports\filename\apps\prforte\edi_sql\kfs
and I don't know how to get rid of it
2) When I use copyhere method I get a dialog box asking me to hit YES
to all. Is there some reference library that I do not have in my code
that I need to add? I know that &H10& is supposed to get rid of that
message but I haven't been able to get it to work. Also I have no
idea how to use XCOPY.
Please help, here is my code:
Sub Unzip2()
DoCmd.SetWarnings False
Dim myNamespace As Outlook.Namespace
Dim myMAPIFolder As Outlook.MAPIFolder
Dim mybinboxFolder As Outlook.MAPIFolder
Dim objItems As Outlook.Items
Dim lngX As Long
'Dim ASNFolder As Outlook.MAPIFolder
Set myNamespace = Outlook.GetNamespace("MAPI")
Set myMAPIFolder = myNamespace.Folders("Mailbox - Group Box")
Set mybinboxFolder = myMAPIFolder.Folders("Inbox")
Set objItems = mybinboxFolder.Items
'Set ASNFolder = mybinboxFolder.Folders("Deleted Items")
mybinboxFolder.GetExplorer
For Each omsg In objItems
'exists for any possible subject.
If omsg.Attachments.Count > 0 Then
If omsg.Subject = "Inventory Status Report" Then
For Each oattachment In omsg.Attachments
Dim FSO As Object
Dim oApp As Object
Dim fname
Dim FileNameFolder
Dim DefPath As String
dtmMyDate = Format(Now(), "mm-dd-yyyy hh-mm-
ss")
If Left(Right(dtmMyDate, 8), 2) < 12 Then
dtmMyDate = dtmMyDate & " am"
Else
dtmMyDate = dtmMyDate & " pm"
End If
fname = "D:\Inventory Reports\" & dtmMyDate &
".zip"
oattachment.SaveAsFile fname
DefPath = "D:\Inventory Reports\" '<<< Change path
If Right(DefPath, 1) <> "\" Then
DefPath = DefPath & "\"
End If
FileNameFolder = DefPath
Set oApp = CreateObject("Shell.Application")
Const FOF_CREATEPROGRESSDLG = &H10&
'Copy the files in the newly created folder
oApp.Namespace(FileNameFolder).CopyHere
oApp.Namespace(fname).Items, FOF_CREATEPROGRESSDLG
'oApp.Namespace(FileNameFolder).CopyHere
oApp.Namespace(fname).Items
On Error Resume Next
Set FSO =
CreateObject("scripting.filesystemobject")
FSO.deletefolder Environ("Temp") & "\Temporary
Directory*", True
Set oApp = Nothing
Set FSO = Nothing
'omsg.Move ASNFolder
Next
End If
End If
Next
DoCmd.SetWarnings True
'--------------------ZIP
PORTION----------------------------------------
End Sub Tag: Verifying IIS certificates Tag: 219233
StdOut.ReadAll blocking?
Hello!
I'm working on a script using the WshShell.Exec() method.
To avoid buffer overflow problem (if I read the whole StdOut at the
end of the execution, sometimes my script hangs) I found a suggestion
on the "Hey, Scripting Guy!" MS blog: use a StdOut.ReadAll inside the
waiting loop.
But please notice these two examples:
-- Ex1, without ReadAll --
Dim elapsedSecs
elapsedSecs = 0
Dim quit
quit = False
Dim objShell
Set objShell = CreateObject("WScript.Shell")
Dim objCmd
Set objCmd = objShell.Exec("ping 10.113.203.200")
Do While quit = False
If objCmd.Status = 1 Then
quit = True
Else
WScript.Sleep 100
elapsedSecs = elapsedSecs + 0.1
End If
Loop
WScript.Echo "Elapsed seconds: " & elapsedSecs
-- output: "Elapsed seconds: 2,8"
-- Ex2, with ReadAll --
Dim elapsedSecs
elapsedSecs = 0
Dim quit
quit = False
Dim objShell
Set objShell = CreateObject("WScript.Shell")
Dim objCmd
Set objCmd = objShell.Exec("ping 10.113.203.200")
Do While quit = False
If Not objCmd.StdOut.AtEndOfStream Then
outBuffer = outBuffer & objCmd.StdOut.ReadAll
End If
If objCmd.Status = 1 Then
quit = True
Else
WScript.Sleep 100
elapsedSecs = elapsedSecs + 0.1
End If
Loop
WScript.Echo "Elapsed seconds: " & elapsedSecs
-- output: "Elapsed seconds: 0"
It seems ReadAll is blocking my loop until the objCmd exits... why?
thanks! Tag: Verifying IIS certificates Tag: 219232
To bring to front existing process...
Hi,
I had written the following codes as separate vbs files and then
called each of them using a batch file that in turn is configured in
Task Scheduler in windows, to run whenever the system starts up.
The problem I'm facing is ... the second process(cdxfm.exe) does not
show as a window on desktop. I mean both the process'(esproc_TUW.exe
and cdxfm.exe) should be seen as normal sized windows whenever I login
with the service account used to run the Task scheduler. But, I see
only the window for 'esproc_TUW.exe' and do not see any window on
desktop for 'cdxfm.exe'. I would like to mention another thing that
this works fine when I run the Task Scheduler manually, however does
not work as expected when the server is restarted and the Task
scheduler takes action on its own. This was verified after logging
into the server using the same service account and did not find the
second process(cdxfm.exe) window open but I can see 2 process ID's for
the 1st one and only 1 process id for the second one, with the second
one not showing up in front as a window. I have tried the following
vbs codes to no avail.
Code 1:
strProcess1 = "cdxserv.exe"
strComputer = "."
WScript.Echo Date & vbTab & Time & vbTab & "Start of Script..."
Call Process1
WScript.Echo Date & vbTab & Time & vbTab & "...End of Script"
WScript.Quit
Sub Process1()
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "D:\ESPS\CoreDoss\esproc_TUW.exe -D -I", 1
WshShell.Run "D:\ESPS\CoreDoss\cdxfm.exe", 1
WScript.Echo Date & vbTab & Time & vbTab & "Created Process: " &
strProcess1 & " on " & strComputer
End Sub
Set WshShell = Nothing
Code 2:
Const priorityNormal = 32
Const SW_SHOWNORMAL = 1 ' ShowWindow (api) constants...
Const SW_SHOWMAXIMIZED = 3
Dim oWMI : Set oWMI = GetObject("winmgmts:")
Dim oProcess : Set oProcess = oWMI.Get("Win32_Process")
Dim oStartupInfo : Set oStartupInfo =
oWMI.Get("Win32_ProcessStartup")
Process1
Process2
Sub Process1()
sCommandLine = "esproc_TUW.exe -D -I"
sCurrentDirectory = "D:\ESPS\CoreDoss\"
oStartupInfo.PriorityClass = priorityNormal
oStartupInfo.ShowWindow = SW_SHOWNORMAL ' SW_SHOWMAXIMIZED
' create process returns a 0 if the process was created successfully.
iResult = oProcess.Create(sCommandLine, sCurrentDirectory,
oStartupInfo, processID)
if (iResult = 0) then ' success
WScript.Echo "Create Process was Successful, " & " processid=" &
processID,vbSystemModal
Else
WScript.Echo "iResult=" & iResult & " processid=" &
processID,vbSystemModal
End if
End Sub
Sub Process2()
sCommandLine = "cdxfm.exe"
sCurrentDirectory = "D:\ESPS\CoreDoss\"
oStartupInfo.PriorityClass = priorityNormal
oStartupInfo.ShowWindow = SW_SHOWNORMAL ' SW_SHOWMAXIMIZED
' create process returns a 0 if the process was created successfully.
iResult = oProcess.Create(sCommandLine, sCurrentDirectory,
oStartupInfo, processID)
if (iResult = 0) then ' success
WScript.Echo "Create Process was Successful, " & " processid=" &
processID,vbSystemModal
Else
WScript.Echo "iResult=" & iResult & " processid=" &
processID,vbSystemModal
End if
End Sub
WScript.Quit
Code3: (Batch file)
Start /min D:\ESPS\CoreDoss\esproc_TUW.exe
Start /min D:\ESPS\CoreDoss\cdxfm.exe
Any help is very much appreciated !!! Tag: Verifying IIS certificates Tag: 219229
Data Not Displaying SQL Express 2005
Hi All
DB - SQL Express 2005
ST - ASP VBScript
Dev Env OS - Win XP IIS5
I am trying to retrieve records from the DB and write them into a csv
file/display onscreen for further processing. What is happening is the
records are retrieved but when I write them into the file or display
them on screen only the first and ninth fields display (fAddress1 &
description) all the rest just come out blank.
If I comment out the first field then the 2nd and ninth display and so
on.
I have tried loading the data into individual variables but the same
still happens and this is now begining to get rather annoying ;-]
Code is below for writing the file:-
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <!--#include virtual="/mws/
Connections/connsmp.asp" --> <%
varSQL = "SELECT TEstJob.fNotes, TEstJob.fUserID,
TEstJob.fInitialLoggedBy, TEstJob.fInitialLogDateTime, "
varSQL = varSQL & "TEstJob.fClientOrderNo,
TEstJob.fEngsSubiesAssigned2NonCompleteVisits, TEstSite.fName AS
SITENAME, "
varSQL = varSQL & "TEstContact.fName AS CONTACTNAME,
TEstContact.fDirectPhoneNo, TEstContact.fAddressPostCode,
TEstContact.fAddressCounty, "
varSQL = varSQL & "TEstContact.fAddressCity, TEstContact.fAddressArea,
TEstContact.fAddress2, TEstContact.fAddress1, "
varSQL = varSQL & "TEstJobType.fName AS JOBTYPENAME,
est_groups.description "
varSQL = varSQL & "FROM TEstJob LEFT JOIN TEstSite ON TEstJob.fSite =
TEstSite.fID "
varSQL = varSQL & "LEFT JOIN TEstContact ON TEstSite.fSiteAddress =
TEstContact.fID "
varSQL = varSQL & "LEFT JOIN TEstJobType ON TEstJob.fJobType =
TEstJobType.fUserID "
varSQL = varSQL & "LEFT JOIN est_groups ON TEstJob.fInitialLoggedBy =
est_groups.fid "
varSQL = varSQL & "WHERE TEstJob.fJobStatus = 4"
Dim rsJobs
Dim rsJobs_numRows
Set rsJobs = Server.CreateObject("ADODB.Recordset")
rsJobs.ActiveConnection = MM_connsmp_STRING rsJobs.Source = varSQL
rsJobs.CursorType = 0 rsJobs.CursorLocation = 2 rsJobs.LockType = 1
rsJobs.Open()
rsJobs_numRows = 0
%>
<%
If NOT rsJobs.EOF Then
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set theFile = FSO.CreateTextFile(Server.MapPath("/MWS/jobs.csv"),
true, false)
While Not rsJobs.EOF
varRecordLine = rsJobs.Fields.Item("fAddress1").Value & "," &
rsJobs.Fields.Item("fAddress2").Value & ","
varRecordLine = varRecordLine &
rsJobs.Fields.Item("fAddressArea").Value & "," &
rsJobs.Fields.Item("fAddressCity").Value & ","
varRecordLine = varRecordLine &
rsJobs.Fields.Item("fAddressCounty").Value & "," &
rsJobs.Fields.Item("fAddressPostCode").Value & ","
varRecordLine = varRecordLine & rsJobs.Fields.Item("fUserID").Value
& "," & rsJobs.Fields.Item("CONTACTNAME").Value & ","
varRecordLine = varRecordLine &
rsJobs.Fields.Item("description").Value & "," &
rsJobs.Fields.Item("fInitialLogDateTime").Value & ","
varRecordLine = varRecordLine &
rsJobs.Fields.Item("fDirectPhoneNo").Value & "," &
rsJobs.Fields.Item("JOBTYPENAME").Value & ","
varRecordLine = varRecordLine & rsJobs.Fields.Item("fNotes").Value &
"," &
rsJobs.Fields.Item("fEngsSubiesAssigned2NonCompleteVisits").Value
theFile.WriteLine(varRecordLine)
rsJobs.MoveNext()
Wend
theFile.Close
rsJobs.Close()
Set rsJobs = Nothing
Set FSO = Nothing
Response.Redirect("/MWS/jobs.csv")
End If
%> Tag: Verifying IIS certificates Tag: 219226
Convert 1,000 word documents to TeX
Hello all,
I'm trying to adapt a script given here
http://www.microsoft.com/technet/scriptcenter/resources/qanda/apr05/
hey0401.mspx
to do a massive conversion from word to TeX using the file converter
word2tex
http://www.chikrii.com/products/word2tex/dl/
What I've done is the fellowing:
'Begin script
Const wdFormatDocument = 0
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='X:\annales'} Where " _
& "ResultClass = CIM_DataFile")
Set objWord = CreateObject("Word.Application")
Dim cnvTeX As FileConverter
For Each objFile in colFiles
If objFile.Extension = "doc" Then
strFile = "X:\annales\" & objFile.FileName & "." &
objFile.Extension
strNewFile = "X:\annales-TeX\" & objFile.FileName & ".tex"
Set objDoc = objWord.Documents.Open(strFile)
For Each cnvTeX In Application.FileConverters
If cnvTeX.ClassName = "TeX32exp" Then
objDoc.SaveAs strNewFile, _
FileFormat:=cnvTeX.SaveFormat
End If
Next cnvTeX
objDoc.Close
End If
Next
objWord.Quit
'End Script
where X:\annales is the directory where the .doc files are stored and X:
\annales-TeX is the diretory where I want the files converted to be
stored. TeX32exp is the ClassName for the FileConverter word2tex.
And guess what?... It does not work :-( I'm sorry but I'm not a vbs guru,
so if anyone could help, I would highly appreciate.
Thanks in advance
--
Christophe Tag: Verifying IIS certificates Tag: 219224
Scripting hosts backwards on my system
Has anyone seen this before? I'm not sure what exactly is backwards.
Is it just the //h: arguments to cscript and wscript?
I created a one line script call whichscript.vbs, with only
'WScript.Echo WScript.FullName' in it. Then did the following at a
command prompt:
----------------------------------------------------------------------------------------
C:\>cscript //h:cscript
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
The default script host is now set to "cscript.exe".
C:\>whichscript.vbs
(This pops up an interactive window saying 'C:\WINDOWS
\System32\CScript.exe')
C:\>cscript //h:wscript
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
The default script host is now set to "wscript.exe".
C:\>whichscript.vbs
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
C:\WINDOWS\System32\CScript.exe
---------------------------------------------------------------------------------------- Tag: Verifying IIS certificates Tag: 219222
Looking for an HTTP Object that works like WinHTTP.WinHTTPRequest.5.1
I need to create this functionality outside of the IIS with an object - pre
.NET code.
The code below is part of a classic ASP.
<%
Set objHttp = Server.CreateObject("WinHTTP.WinHTTPRequest.5.1")
objHttp.open "POST", www.Microsoft.com/myPage.asp, False
WinHttpRequestOption_SslErrorIgnoreFlags = 4
objHttp.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = &H3300
objHttp.Send "firstName=Dick&lastName=Cheney&status=GodKnows"
sReturnedResponse = objHttp.responseText
%>
So you just cannot do an OLE call ==>
CreateObject("WinHTTP.WinHTTPRequest.5.1") , becuase this object is part of
the IIS server and is isolated, I think.
Does anybody know an Object that is part of the Win 2003 or 2008 (already
installed) but can be called with CreateObject("xxxxx").
Example: MSXML does not work, because you cannot POST the Named pairs
seperately, it has to be part of the URL. And perhaps there is no way of
setting flags like the SslErrorIgnoreFlag
Set XMLHTTP = CreateObject("Msxml2.XMLHTTP")
XMLHTTP.Open "POST", sUrl & "?" & sPairs, False
x = XMLHTTP.send()
Anything will help Tag: Verifying IIS certificates Tag: 219214
Change URL in XLS file
Hello All,
I have a directory that has several XLS files all uniquely named. In each
XLS file there is a Header called URL. Under that header is a URL link
that I would like to change (Example: http://rwa.squadron.com/...) in each
XLS file located in that directory.
Each week the only thing changing in the url would be the first part of the
URL rwa would change to rwb. Next week that would change to rwc and the
week after that to rwd.
Is there a way to prompt the user to enter the new url and then traverse
through the directory and go into each excel file and change the url to the
one that was entered in by the user? In some cases, an excel file will have
multiple rows with an url address, it would have to change them as well.
Any and all help in this matter is greatly appreciated.
Argus Tag: Verifying IIS certificates Tag: 219208
xml PDF
Hi,
Does anyone know how to convert xml data into a formated PDF doc using
vbscript. I have a lot of experience with xml xsl transformations... Im not
looking for ways to use word and a print driver I was hoping for a component,
preferably freeware, that someone knows about. Any recommendations would be
great, or even where to start looking?
Rob Tag: Verifying IIS certificates Tag: 219198
Directory Listing
I have developed a routine which prepares a directory listing for a specific
folder and save this information into a text file. This text file would be
used to send the required files via SFTP to a unix server.
My problem is that the case of the file name changes to lower case. For
example, the file name would appear in the folder as OPICS_Greeks.txt but
would appears as opics_greeks.txt in the text file. How can I retain the
original file name structure in the text file?
Below is the snippet:-
Set objTextFile = objFSO.OpenTextFile _
(StrFileName, ForAppending, True)
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFileList = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='" & strLocalFolder & "'} Where " _
& "ResultClass = CIM_DataFile")
For Each objFile In colFileList
' Define Short Name
StrFile = Len (objfile.Name)
StrDiff = (StrFile - strStart) + 1
ShortName = MID(objfile.name, strStart, StrDiff)
'Write Files to be transmitted to Text file
objTextFile.WriteLine ShortName
Next
'Close Transmit Text File
objTextFile.close Tag: Verifying IIS certificates Tag: 219194
Help with Timer loop
Hey All,
I need to modify the length of this timer loop for this script i found
and need some feedback on if I am reading this timer loop correctly.
Do While intCounter < 3600
If objFso.FileExists(SEPExec) Then
logResults = logMessage("installSAV", "Installation of SEP
Completed")
intCounter = 3700
Else
Wscript.sleep 50
intCounter = intCounter + 1
end If
Loop
I need to basically know what is the max time in seconds this loop is
running before it goes on.
Is it 180 seconds?
If I wanted to increase it to 240 seconds can I just change the
wscript.sleep 50 to wscript.sleep 67?
Thanks for any assistance.
Clay Tag: Verifying IIS certificates Tag: 219193
438 Object doesn't support this property or method
m having an problem with a SQL Server 2000 update in a VBScript program
executing in a DTS Package.
Source extract and results
'***** set Connection
Set cnChangepoint = CreateObject("ADODB.Connection")
cnChangepoint.Open "Provider=SQLOLEDB;Server=" & _
DTSGlobalVariables("gvSQLServerName").Value & ";UID=" &
DTSGlobalVariables("gvdbUserId") & _
";PWD=" & DTSGlobalVariables("gvdbPassword") & ";Database=*********"
'*** Set Variables
strResourceText1 = DTSGlobalVariables("gvResourceText1").Value
strResourceText2 = DTSGlobalVariables("gvResourceText2").Value
strResourceText3 = DTSGlobalVariables("gvResourceText3").Value
strCHRISResourceId = DTSGlobalVariables("gvCHRISResourceId").Value
strErrorCode = "500,"
If strResourceText1 <> strUDFCompany Then
strCHQResources = "Update CHQ_Resources Set ErrorCodes = '" & strErrorCode
& "'" & " where CHRISResourceId = '" & strCHRISResourceId & "'"
cnChangepoint.Execute (strCHQResources)
If Err.Number <> 0 Then
'**** For Debugging purpose
strData = "UDF Company Error " & VBCrlf & _
"Value of Err Number is " & Err.Number & VbCrLf & _
"Value of Err Description is " & Err.Description & VbCrLf & _
"Value of strChqResources is " & strCHQResources & VbCrLf & _
"Value of strResourceText1 is " & strResourceText1 & VbCrLF & _
"Value of strUDFCompany is " & strUDFCompany & VbCrLf & _
"Value of strErrorCode is " & strErrorCode & VbCrLf & _
"Value of gvCHRISResourceId is " &
DTSGlobalVariables("gvCHRISResourceId").Value
Call WriteToFile(strWriteToFile, strData, 2)
End If
End If
'*** Results
UDF Company Error
Value of Err Number is 438
Value of Err Description is Object doesn't support this property or method
Value of strChqResources is Update CHQ_Resources Set ErrorCodes = '500,'
where CHRISResourceId = '{A8C820C0-382B-4A3A-9393-1C49BE92EA0F}'
Value of strResourceText1 is 2
Value of strUDFCompany is 1
Value of strErrorCode is 500,
Value of gvCHRISResourceId is {A8C820C0-382B-4A3A-9393-1C49BE92EA0F} Tag: Verifying IIS certificates Tag: 219186
vbs excel "if" function - how
Hi.
I have script as follow:
'--==--==--==--==--==--==--==--==--==--==--==--==
set objexob = createobject("excel.application")
set ex=objexob.workbooks.add
ex.application.visible = false
ex.worksheets(1).cells(1,1).value="2"
ex.worksheets(1).cells(1,2).value="2"
ex.worksheets(1).cells(1,3).value="=A1+B1"
ex.worksheets(1).cells(1,4).value="=if(C1=4;" & chr(34) & "yes" &
chr(34) & ";" & chr(34) & "no" & chr(34) & ")"
ex.saveas("c:\test.xls")
ex.close
'--==--==--==--==--==--==--==--==--==--==--==--==
when I trying run above script then i get error.
Please help me to resolve this problem.
Regards. Tag: Verifying IIS certificates Tag: 219185
Manipulating group policies on XP
Hi,
Is it possible to add/edit a local group policy on XP Pro using
VBScript? I want to automate in a script what you can do manually with
the following steps:
1. Run gpedit.msc
2. Go to "User Configuration > Administrative Templates > Windows
Components > Attachment Manager"
3. Go to the properties for "Inclusion list for moderate risk file
types", click "Enabled" and enter ".exe" in the box.
I'm trying to get rid of the warning message that you see when you try
to run an .exe file from a Samba share on another machine, and this
seems to be the way to go about it, but I'd prefer to make it part of
the installation script rather than telling the users to perform the
above steps themselves.
Cheers
John Tag: Verifying IIS certificates Tag: 219184
VBScript That Changes Its Identity
Can a VBScript change its identity after it has started, so that it switches
to running under a different username? This is for the purpose of getting
access to a different set of privileges.
Thanks,
--
Joseph Tag: Verifying IIS certificates Tag: 219171
Script to delete local user accounts?
We're running XP Professional with SP2. Is there a script (VB, WSH,
etc) that could be used to delete all local accounts on the machine
except for the builtin Windows accounts (as well as any ASP.net
accounts) and the account of the user who is currently logged in. I
know that I could figure out the account of the the currently logged
in user by using the %username% environment variable. I was thinking
of the Addusers.exe utility in the Server Resource Kit, but I'm not
sure that it will work for my needs. What we're trying to eliminate
is any users who may have created local "back door" accounts while
they were administrators of their PCs. We're about to take these
rights away but we want to ensure there is no way they can circumvent
the process by simply using a seperate local account to login with
full rights. Suggestions?
Thanks! Tag: Verifying IIS certificates Tag: 219167
Enumerating user's universal groups membership from ANOTHER DOMAIN
Hi!
I have to enumerate user's groups membership, but actually I'm only getting
local domain groups list.
All universal groups hosted by others domain are not listed by the following
VBScript code:
set wshnetwork = createobject("WScript.Network")
set objfso = createobject("Scripting.FileSystemObject")
set adsysinfo = createobject("adsysteminfo")
set currentuser = getobject( "LDAP://" & adsysinfo.username )
if isarray( currentuser.memberof) then
strgroups = join( currentuser.memberof )
else
strgroups = currentuser.memberof
end if
We already fixed our ADUC with the following Microsoft fix:
http://support.microsoft.com/kb/833883
But that seem to not any impact on VBScript code...
Any idea how to fix that?
Thanks.
Claude Lachapelle
Systems Administrator, MCSE Tag: Verifying IIS certificates Tag: 219166
Load Web form with Excel row (code example)
Can someone point me to some working code that will allow a WEB form to be
loaded with a row of data from Excel.
Rick Tag: Verifying IIS certificates Tag: 219165
Is it possible to use WMI via vbscript to query IIS server (Win 2000/IIS 5
and 2003/IIS 6) for SSL certificates and their expiration dates?