help...
Hi all, I´m new in VBScript and I´m trying that....
I select data from a database, after I do a while to show them in the
screen, and there is one textfield "txtday" to enter the number of
days, and then when click on "Save" botton I need to update the value
in the database. How do I check If I have more then one in the screen?
How do I check the quantity of days in each line to save in the
correct hdCodParametro in my database? How shoud be my Validate()
function to check each field and execute a procedure to save it in the
database?
I appreciate your help...
Thanks
sandra
<%
.
.
.
Set rsDados = Server.CreateObject("ADODB.RecordSet")
sSQL = "Select COD_PARAMETRO, DSC_PARAMETRO, DSC_VALOR_PARAMETRO from
PARAMETROS_0133T (nolock) where COD_PARAMETRO = 219 OR COD_PARAMETRO =
220"
retorno.Open sSQL, cnSQL
if retorno.EOF then
Set retorno = Nothing
response.write ("Error....")
end if
%>
<html>
<head>
<title>Title...title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="750" border="0" cellpadding="5" cellspacing="0">
<tr>
<td background="fundo_escuro_peq.gif"><font face="verdana"
size="2"><b><font color="#FFFFFF" size="1">::</font><font
face="verdana" size="2"><b><font face="verdana" size="2"><b><font
color="#FFFFFF" size="1">
Funcionário com nível de acesso
administrativo</font></b></font></b></font><font color="#FFFFFF"
size="1">
-> Atualizar Parâmetros</font></b></font></td>
</tr>
<tr>
<td height="365" valign="baseline">
<div align="center">
<form name="form1" method="post">
<table width="700" border="0" cellpadding="3" cellspacing="0">
<%
while Not retorno.Eof
%>
<tr>
<input type="hidden" name="hdCodParametro"
value="<%=retorno("COD_PARAMETRO")%>">
<td bgcolor="#DCECF5" width="602" class="LabelAsp"
name="txtDecr_Parametro"><%=retorno("DSC_PARAMETRO")%> </td>
<td width="86" bgcolor="#DCECF5">
<div align="center"><font face="verdana" size="2">
<input type="text" name="txtday" size="4" maxlength="4"
value="<%=retorno("DSC_VALOR_PARAMETRO")+contador%>"> <b> Day
</b></font></div></td>
</tr>
<%
retorno.MoveNext
Wend
retorno.close
cnSQL.close
%>
</table>
<p>
<input type="submit" name="Submit" value="Save"
onclick="Validate();return false;"><br>
</p>
</form>
</body>
</html> Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147079
Combo box is always on top of everything!
This is a multi-part message in MIME format.
------=_NextPart_000_0013_01C3A91C.36304F60
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
When I place a layer over something else containing a combo or text box, =
the
combo or text box remains on top. it looks terrible, and I can't seem =
to
find a way around this. Anyone know what to do?
Here is the simple example:
<html>
<head>
</HEAD>
<BODY>
<SELECT id=3Dselect1 name=3Dselect1 style=3D"z-index:1">
<OPTION>this is select box</OPTION>
</SELECT>
<div name=3D"div1" id=3D"div1"
style=3D"position:absolute;margin-left:-100;margin-top:0;z-index:10">
<table bgcolor=3D"Gainsboro" border=3D"1" width=3D100 height=3D100>
<tr><td>some text</td></tr>
</table>
</div>
</body>
</html>
Thank you for your answer,
Simon
Thanks,
Simon
------=_NextPart_000_0013_01C3A91C.36304F60
Content-Type: text/html;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-2">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>When I place a layer over something =
else containing=20
a combo or text box, the<BR>combo or text box remains on top. it =
looks=20
terrible, and I can't seem to<BR>find a way around this. Anyone =
know what=20
to do?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3D"Times New Roman" =
size=3D3>Here is the=20
simple=20
example:<BR><BR><html><BR><head><BR></HEAD><BR><BODY=
><BR><SELECT=20
id=3Dselect1 name=3Dselect1 =
style=3D"z-index:1"><BR><BR> <OPTION>this is=20
select box</OPTION><BR><BR></SELECT><BR><BR><div =
name=3D"div1"=20
id=3D"div1"<BR>style=3D"position:absolute;margin-left:-100;margin-top:0;z=
-index:10"><BR><BR> <table=20
bgcolor=3D"Gainsboro" border=3D"1" width=3D100 =
height=3D100><BR> =20
<tr><td>some=20
text</td></tr><BR> </table><BR></div><BR><=
;/body><BR></html><BR><BR>Thank=20
you for your answer,<BR>Simon</FONT><BR></DIV>
<DIV><BR><BR>Thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Simon<BR></DIV></FONT></BODY></HTML>
------=_NextPart_000_0013_01C3A91C.36304F60-- Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147076
Vbscript Ping
How can I ping an IP address to get a return code (if the IP address
responds) to continue to some other function?
eg. If Ping=1 (ie alive) then do this else don't do this!
Had a look through the internet and can't seem to find anything. Don't mind
installing DLL if there is anything out there....
Thanks
DG Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147074
pivot html image?
Is there a way to show a dynamically loaded image
rotated/pivoted 90 degrees from the way it's saved?
Here is an example of my code:
<p><img border="0" src="/Cert/<%Response.Write
Request.QueryString("Stock No")%>.GIF"width="671"
height="535" ></p>
The gif image is oriented up and down, but I want to show
the image in my html/vbscript page pivoted 90 degrees, so
it can be printed properly.
There are thousands of the images for items in a database,
so changing the original gif isn't an option.
Or, is there a way to print the image in landscape,
instead of portrait?
thanks,
Eric Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147068
Need Urgent Help for a VBScript Function
I have a string in one variable. With that string content,
there is an object in the Web page. I want to refer that
object using this variable..
eg:-
p="Checkbox1"
Now want to check that checkbox using variable p
ie. instead of writing
Checkbox1.checked=true
I want to write it using variable p...
Please help me... Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147053
Detecting OS correctly
Hello,
Can anybody tell me of an accurate way to determine the
OS name and version (and also service pack level if poss)
of machines running the following (all versions):
Win95, Win98, NT4, Windows 2000, Windows XP
I obviously can't use WMI as Win95 and 98 (and I think
NT4) don't come with it... I need to stick to what I know
is installed and that pretty much just leaves VBScript.
I have seen many ways of achieving this on the web but
they all seem to target particular OS versions... I need
to cover them all...
Any suggestions?
Regards Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147047
Client Side odbc connection?
Hello, is it possible to create and use an odbc
connection on the client side? If so, what is the code
to do so?
Thanks,
Sean Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147042
Script to extract driver information from .inf files
Hi Gang,
Similar to my last post, I'm trying to get a script to extract driver
version, name and other information from all .inf files in a given
directory. I've hacked at an excellent script I found on the
cwashington website. The problem I get is a subscript out of range
error... the line that gets the error is:
dverpos = Instr(4, Inffile(1), "Driverver", 1)
and here is the script:
' GetVer.VBS
' Example: CScript.EXE GetVer.VBS /f:"C:\Documents and
Settings\Administrator\local settings" /r:c:\test.txt
'Option Explicit
'On error resume next
Dim objArgs: Set objArgs = WScript.Arguments
Dim objFSo: Set objFSo =
CreateObject("Scripting.FileSystemObject")
Dim sHelpString, sRootFolder, sReport, sReportName
sHelpString = "GETVER.VBS - Tool to list all files that have a version
number in" & vbcrlf _
& "a specified folder and its subfolders" & vbcrlf & vbcrlf
_
& "/F:<path> - Specify the root folder to gather the
information" & VbCRLf _
& "/R:<path> - Specify the file to produce the output to. It
will" & vbCRLf _
& " overwrite the file if it already exists"
If objArgs.Count = 0 Then Wscript.Echo sHelpString: Wscript.Quit
If objArgs(0) = "/?" Then Wscript.Echo sHelpString: Wscript.Quit
Dim I
For I = 0 to objArgs.Count - 1
If UCase(Left(objArgs(I),3)) = "/F:" Then sRootFolder =
Trim(Mid(objArgs(I),4))
If UCase(Left(objArgs(I),3)) = "/R:" Then sReportName =
Trim(Mid(objArgs(I),4))
Next
Set sReport = objFSo.CreateTextFile(sReportName, True)
RecurseFldr (sRootFolder)
Sub RecurseFldr(sFolderName)
Dim oFolder, cFolder, cFile, sUnit, sVer
If not objFSo.FolderExists(sFolderName) Then
Wscript.Echo "Error: " & chr(34) & sFolderName & chr(34) & " does
not exist or is no longer available"
Wscript.Quit
End If
Set oFolder = objFSo.GetFolder(sFolderName)
Set cFolder = oFolder.Subfolders
Set cFile = oFolder.Files
'Stack this procedure for every folder in the collection
For Each sUnit In cFolder
' sReport.WriteLine "Folder - " & sUnit
RecurseFldr(sUnit)
Next
'Then process each file in the current folder
For Each sUnit In cFile
If Right(sUnit.Path, 3) = "inf" then
dverpos = 0
devdescpos = 0
Set i = objfso.OpenTextFile(sUnit.Path, 1)
ReadAllTextFile = i.ReadAll
inffile = Split(Readalltextfile, "[Version]", -1, 1)
sReport.Write vbcrlf & vbcrlf & "Filename: " & sunit.path & vbcrlf
sReport.Write inffile(0)
dverpos = Instr(4, Inffile(1), "Driverver", 1)
if dverpos > 0 then
dver = Mid(Inffile(1), dverpos, 50)
dvers = split(dver, vbcrlf, 1, 1)
sReport.Write vbcrlf & dvers(0)
end if
devdescpos = Instr(4, inffile(1), "DeviceDesc=", 1)
'wscript.echo devdescpos
if devdescpos > 0 then
dver = Mid(Inffile(1), devdescpos, 100)
dvers = split(dver, vbcrlf, 1, 1)
sReport.Write vbcrlf & dvers(0)
End if
devdescpos = Instr(4, inffile(1), "FullProductName=", 1)
if devdescpos > 0 then
dver = Mid(Inffile(1), devdescpos, 100)
dvers = split(dver, vbcrlf, 1, 1)
sReport.Write vbcrlf & dvers(0)
End if
End If
Next
End Sub Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147032
dos equivallet to copy /d
looking for way to run copy /d in vbs
I am copyinng encrypted files from XP workstationn to NT Domain server and
need to decrypt to save it can be done with a bat file with the copy /d
however I cannot figure out how to do this with a vbs script
Assistance Greatly appreciated
P Creighton Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147030
Script to report file version, description...
Gday all,
I'm trying to write a script that will go through the entire hard
drive, give me the version number and also extended properties of each
file on the PC, but only for files that will report a version number.
I found an excellent script on cwashington.netreach.net by Voltaire
Toledo that does the version number bit, and I've attempted to modify
it to report things like Description, Author etc. When I run it I get
the following error:
getver.vbs(49, 5) Microsoft VBScript runtime error: Object required:
'objFolder'
I don't quite understand this, as its clearly defined.
Here is the script (with my hacked modifications):
' GetVer.VBS
' Example: CScript.EXE GetVer.VBS /f:"C:\Documents and
Settings\Administrator\local settings" /r:c:\test.txt
'Option Explicit
Dim objArgs: Set objArgs = WScript.Arguments
Dim objFSo: Set objFSo =
CreateObject("Scripting.FileSystemObject")
Dim sHelpString, sRootFolder, sReport, sReportName
sHelpString = "GETVER.VBS - Tool to list all files that have a version
number in" & vbcrlf _
& "a specified folder and its subfolders" & vbcrlf & vbcrlf
_
& "/F:<path> - Specify the root folder to gather the
information" & VbCRLf _
& "/R:<path> - Specify the file to produce the output to. It
will" & vbCRLf _
& " overwrite the file if it already exists"
If objArgs.Count = 0 Then Wscript.Echo sHelpString: Wscript.Quit
If objArgs(0) = "/?" Then Wscript.Echo sHelpString: Wscript.Quit
Dim I
For I = 0 to objArgs.Count - 1
If UCase(Left(objArgs(I),3)) = "/F:" Then sRootFolder =
Trim(Mid(objArgs(I),4))
If UCase(Left(objArgs(I),3)) = "/R:" Then sReportName =
Trim(Mid(objArgs(I),4))
Next
Set sReport = objFSo.CreateTextFile(sReportName, True)
RecurseFldr (sRootFolder)
Sub RecurseFldr(sFolderName)
Dim oFolder, cFolder, cFile, sUnit, sVer
If not objFSo.FolderExists(sFolderName) Then
Wscript.Echo "Error: " & chr(34) & sFolderName & chr(34) & " does
not exist or is no longer available"
Wscript.Quit
End If
Set oFolder = objFSo.GetFolder(sFolderName)
Set cFolder = oFolder.Subfolders
Set cFile = oFolder.Files
'Stack this procedure for every folder in the collection
For Each sUnit In cFolder
' Begin my modifications here :)
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(sUnit)
For i = 0 to 33
arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)
Next
For Each strFileName in objFolder.Items
For i = 0 to 33
sreport.Writeline arrHeaders(i) _
& ": " & objFolder.GetDetailsOf(strFileName, i)
Next
Next
'End my modifications
RecurseFldr(sUnit)
Next
'Then process each file in the current folder
'For Each sUnit In cFile
' sVer = objFSo.GetFileVersion(sUnit)
' If sVer<>"" Then sReport.WriteLine "File - " & sUnit.Path &
vbTab & "Version - " & sVer
'Next
End Sub
Thanks in advance
Paul Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147029
Newbie problem--should be easy
I am brand new at this and virtually totally clueless; the terms and =
syntax are a complete mystery; nothing like writing up bat files.. (I'm =
going to get a book on this, but that's going to have to wait until next =
payday at least.)
Meantime I tried to edit a simple script I'd seen done before for =
another purpose which looked like it could be altered to simply copy a =
file or two from here to there. Figured once I got it figured out I'd =
add it into the more complicated vbs script I's working on.
I'm trying to copy and concatenate files.
Figured this looked like it would work. It does not.
Set WSHShell =3D WScript.CreateObject("WScript.Shell")
rcmd =3D "copy /y /b d:\files\text.txt+d:\files\test2.txt =
f:\temp\new.eml"
WshShell.Run(rcmd)
What am I doing wrong? What would work? Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147027
Copying SID to SIDHistory
Hi all,
I am new to vbscript and I am trying to copy the SID from one
Domain account to the SIDhistory of an account in a different domain.
This is what I was thinking:
Set user = GetObject(LDAP path to user in old domain)
SID = user.Get("objectSid")
WScript.Echo SID
Set NewUser = GetObject(LDAP path to user in new domain)
NewUser.Put "sIDHistory", SID
NewUser.SetInfo
I get an error that says "a constraint violation has occured". Like I
said, I'm a noob so I may be on the wrong path or missing some critical
steps. I would appreciate any help, or if someone has done this, maybe a
clue as to which way to approach this problem.
Thanks,
Rich Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147026
Tricky Text File
I've combined alot of the things that I've learned from this newsgroup and
created some really cool text manipulating programs. I'd like to thank all
of you that have helped me with my struggles these last few weeks (Chad, Dag
Sunde, Collin, and Michael Harrington - just to name a few). I'm really
amazed how slick these little programs work.
For my next task, I'd like to do something very similar. The difference is
that there can be upto 3 Product lists for each customer.
http://www.swandust.com/IN2.txt is a sample file. I'd like the output
(output.csv) to display something like the following:
CustNum,DelAdd,Stock,Qty,Freq
4,SIR ADAM BECK MANOR,WINTER EXTRA MATS
,240 SYDENHAM ST,3 X 12 BROWN RENTAL MAT ,1,E4W
,"LONDON, ON",4 X 8 GREY RENTAL MAT ,1
,Tel: ( ) -
,,MONTHLY ALL YEAR
,,3 X 5 GREY RENTAL MAT,1,E4W
,,4 X 8 GREY RENTAL MAT,3
37,STUDER'S VARIETY,BI-WEEKLY
,336 JOHN ST S,3 X 8 RED RENTAL MAT,1
,"AYLMER, ON",4 X 6 RED RENTAL MAT,1
,Tel: (519) 773-9016,3 X 5 AIR FLEX MAT,1
40,SCOTIA BANK,SUMMER STOCK MONTHLY
,199 BROADWAY,3 X 8 GREY RENTAL MAT,1,E4W
,"TILLSONBURG, ON", 4 X 6 GREY RENTAL MAT,1
,Tel: (519) 688-6400,4 X 8 GREY RENTAL MAT,1
,,4 X 6 SCOTIABANK LOGO MAT,1
,,BIWEEKLY WINTER STOCK
,,3 X 5 GREY RENTAL MAT,2,E2W
,,3 X 8 GREY RENTAL MAT,2
,,3 X 12 GREY RENTAL MAT,3
,,4 X 6 GREY RENTAL MAT,2
,,4 X 8 GREY RENTAL MAT,1
,,4 X 6 SCOTIABANK LOGO MAT,1
I think the below code is a great start. Running this code converts a UNIX
text file into my desired output (.csv). However, it only converts a file
with one list. I hope that you guys can all help me out with the trickier
output (above). Thanks in advance.
Private Sub Command1_Click()
Dim mystring As String, i As Long
Dim cusnum As String, printtofile As Boolean
Dim address(14) As String * 24, product(14) As String * 8
Dim quan(14) As String * 4, freq As String
Dim description(14) As String * 26
Dim InFile As Integer, OutFile As Integer
Call UNIX_DOS
InFile = FreeFile
Open "c:\temp.txt" For Input As InFile
OutFile = FreeFile
Open "c:\OUT1.csv" For Output As OutFile
Write #OutFile, "Cusnum", "Address", "Product", _
"Description", "Quantity", "Frequency" 'Headings
For i = 0 To 13 'initialize arrays
address(i) = " " '24 spaces
product(i) = " " '8 spaces
description(i) = " " '26 spaces
quan(i) = " " '4 spaces
Next i
Do While Not EOF(InFile)
printtofile = False 'reset
Line Input #InFile, mystring
If InStr(mystring, "Customer Number") > 0 Then
cusnum = Trim$(Mid$(mystring, 23, 6))
End If
If InStr(mystring, "Delivery Address:") > 0 Then
For i = 0 To 4
Line Input #InFile, mystring
address(i) = Trim$(mystring)
Next i
End If
'catch the frequncy input
If InStr(mystring, "=== === === === ====") > 0 Then
Line Input #InFile, mystring
freq = Trim$(Mid$(mystring, 20, 5))
Line Input #InFile, mystring
freq = freq & Trim$(Mid$(mystring, 20, 5))
If freq = "A" Or freq = "B" Or _
freq = "C" Or freq = "D" Then freq = "E4W"
If freq = "AC" Or freq = "BD" Then freq = "E2W"
If freq = "AB" Or freq = "CD" Then freq = "E1W"
End If
If InStr(mystring, "=== ======== ==") > 0 Then
i = 0
Do Until InStr(mystring, "*******") > 0
' ie until we reach Product end
Line Input #InFile, mystring
If Val(Left$(mystring, 11)) > 0 Then
product(i) = Trim$(Mid$(mystring, 11, 8))
description(i) = Trim$(Mid$(mystring, 22, 26))
quan(i) = (Mid$(mystring, 66, 4))
i = i + 1
End If
Loop
printtofile = True
End If
'now write to file
If printtofile = True Then
Write #OutFile, cusnum, address(0), product(0), _
description(0), quan(0), freq
For i = 1 To 13
Write #OutFile, , address(i), product(i), _
description(i), quan(i)
If address(i) = " " _
And product(i) = " " Then Exit For
Next i
For i = 0 To 13 're initialize arrays
address(i) = " "
product(i) = " "
description(i) = " "
quan(i) = " "
Next i
freq = "" 'reset
End If
Loop
Close InFile, OutFile
'remove temp file
Kill ("c:\temp.txt")
Print "DONE!"
End Sub
'convert UNIX text to DOS text
Private Sub UNIX_DOS()
Dim MyUnixFile As String
Dim MyDosFile As String
MyUnixFile = "c:\IN.txt"
MyDosFile = "c:\temp.txt"
Dim S As String
Open MyUnixFile For Binary As #1
S = String(LOF(1), vbNullChar)
Get 1, , S
Close #1
Open MyDosFile For Output As #1
Print #1, Replace(S, vbLf, vbCrLf);
Close #1
End Sub Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147025
All 'Domain Users" group to local 'Power Users' group
Hello all
I have several hundred workstations that I need to add the 'Domain Users'
group to the local machines 'Power Users' group. I assume the easiest way
to do this is with a group policy and a login script. I found the following
script in a previous posting and tried to modify it for my purposes without
much luck. If someone could tell me if I'm on the right track with this
script and how to modify it, I'd be grateful. I'm running a windows 2k
domain with all windows XP workstations.
Thanks for the help
James
From: "Jim Campau" <Jim_Campau@bausch.com>
On Error Resume Next
prbCount= 0
Dim Computer
Set WshNetwork = WScript.CreateObject("WScript.Network")
strComputerName = WshNetwork.ComputerName
strLocalGroup="Power Users"
strGroupName="TestDomain\Domain Users"
strGroupName=Replace (strGroupName, "\", "/")
Set strGroup= GetObject("WinNT://" & strComputerName & "/" & strLocalGroup)
Set strUser= GetObject("WinNT://" & strGroupName)
strGroup.Add(strUser.AdsPath)
'msgbox strUser.AdsPath
if err.number <> 0 then
prbCount=prbCount+1
msgbox"ERROR - " & strGroupName & " Could not be added to " &
strComputerName & " Error Number: 0x" & Hex(err.number) & " " &
err.description
wscript.quit
end if
msgbox "Done" Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147023
Microsoft VBScript runtime error: ActiveX component can't create object 'GetObject'
I have written a simple VBscript to find out the free disk space on a
local machine. The script is as follows:
set WMI = GetObject("WinMgmts:")
for each Disk in WMI.InstancesOf("Win32_LogicalDisk")
if Disk.DeviceID = "C:" Then
WScript.Echo "Instance:", Disk.Path_.Relpath , "Free space = " ,
Disk.FreeSpace
end if
next
I saved this script to disk.vbs and i run it using cscript command on
dos window.
cscript disk.vbs
This script runs on some machines perfectly. On some machines it gave
the following error : Microsoft VBScript runtime error: ActiveX
component can't create object 'GetObject'. I searched thru many google
groups and i found that the error might be that "host is missing WMI
capabilities".
I don't know how to enable this functionality. Is it a service which
is stopped on that particular machine? Is this some different error
altogether? Can anyone please help me out on this. I am new to
scripting so i appreciate ur help. Thanks.
Pranav Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147022
Getting hta "refreshed" from script
I have an hta in which I change some text in a table element to tell the
user what is happening.
After changing the text to "Loading", the script moves onto an xml load and
transform.
The table does not seem to get re-displayed in time and the transform
functions seems to absorb all the resources while it happens (10 seconds).
After the transform, the table is updated again to "Viewing". This is the
first change that is rendered.
If I put a msgbox in front of the load and transform, when the message is
displayed, the table is updated.
If I comment out the load and transform, the table is updated too
Anyone know how I can force the rendering to happen before the transform
"takes over"
TIA
--
Rickety Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147005
data verticaly
How to read a data from a file where record information
store verticaly into SQL? Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 147003
Last Logon for workstation in an NT DOMAIN
I have a list of computer names that I need to check for
the last date/time the device logged on to the NT Domain.
Please help!
Thanks! Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146999
Script to import email addressess
Hi,
I had re-modify Richard's script (Thank you and his site
is http://www.rlmueller.net)and I am receiving an error
stating "The server rejected one or more recipient
addressess. The server reponse was: 550 5.1.1
<c:emails.txt>....User UnKnown" Not sure what has gone
wrong. I have a file "Emails.txt" in C:\ drive containing
my user's Email address. See below of the script I re-
modify from Richard.....
Option Explicit
Dim strFileName, strNTName, objShell, lngBiasKey, lngBias,
k
Dim objRootDSE, strDNSDomain, objDomain, objMaxPwdAge,
intMaxPwdAge
Dim objDate, dtmPwdLastSet, lngFlag, blnPwdExpire
Dim lngHighAge, lngLowAge, lngDate, dtmPwdExpires
Dim objConnection, objCommand, objRecordSet
Dim strFilter, strQuery
Dim strEmail, objEmail
Const ADS_UF_PASSWD_CANT_CHANGE = &H40
Const ADS_UF_DONT_EXPIRE_PASSWD = &H10000
' Specify the file of email addresses.
strFileName = "c:\emails.txt"
' Obtain local time zone bias from machine registry.
Set objShell = CreateObject("Wscript.Shell")
lngBiasKey = objShell.RegRead
("HKLM\System\CurrentControlSet\Control\" _
& "TimeZoneInformation\ActiveTimeBias")
If UCase(TypeName(lngBiasKey)) = "LONG" Then
lngBias = lngBiasKey
ElseIf UCase(TypeName(lngBiasKey)) = "VARIANT()" Then
lngBias = 0
For k = 0 To UBound(lngBiasKey)
lngBias = lngBias + (lngBiasKey(k) * 256^k)
Next
End If
' Determine domain maximum password age policy in days.
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
Set objDomain = GetObject("LDAP://" & strDNSDomain)
Set objMaxPwdAge = objDomain.MaxPwdAge
' Account for bug in IADslargeInteger property methods.
lngHighage = objMaxPwdAge.HighPart
lngLowAge = objMaxPwdAge.LowPart
If lngLowAge < 0 Then
lngHighAge = lngHighAge + 1
End If
intMaxPwdAge = -((lngHighAge * 2^32) _
+ lngLowAge)/(600000000 * 1440)
' Use ADO to search the domain for all users.
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOOBject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
' Filter to retrieve all user objects.
strFilter = "(&(objectCategory=person)(objectClass=user))"
strQuery = "<LDAP://" & strDNSDomain & ">;" & strFilter _
& ";sAMAccountName,pwdLastSet,userAccountControl,mail;subtr
ee"
objCommand.CommandText = strQuery
objCommand.Properties("Page Size") = 100
objCommand.Properties("Timeout") = 30
objCommand.Properties("Cache Results") = False
' Enumerate all users. For users whose password can expire,
' determine when the password expires.
Set objRecordSet = objCommand.Execute
Do Until objRecordSet.EOF
strNTName = objRecordSet.Fields("sAMAccountName")
lngFlag = objRecordSet.Fields("userAccountControl")
blnPwdExpire = True
If (lngFlag And ADS_UF_PASSWD_CANT_CHANGE) <> 0 Then
blnPwdExpire = False
End If
If (lngFlag And ADS_UF_DONT_EXPIRE_PASSWD) <> 0 Then
blnPwdExpire = False
End If
' Only continue if the password can expire.
If blnPwdExpire = True Then
' Determine when password last set.
lngDate = objRecordSet.Fields("pwdLastSet")
Set objDate = lngDate
dtmPwdLastSet = Integer8Date(objDate, lngBias)
' Continue only if password was ever set.
If dtmPwdLastSet > #1/1/1601# Then
' Determine when the password expires.
dtmPwdExpires = DateAdd("d", intMaxPwdAge,
dtmPwdLastSet)
' Determine if password expires within the next 10
days.
If dtmPwdExpires < DateAdd("d", 10, Now) Then
If dtmPwdExpires < Now Then
' Password already expired.
Else
' Password expires in the next 10 days.
strEmail = strFileName
If strEmail <> "" Then
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "icmpbell@yaoo.com
objEmail.To = strEmail
objEmail.Subject = "Network Password"
objEmail.TextBody = "The network password for
user " _
& strNTName & strFileName & " will expire "
& dtmPwdExpires
'==This section provides the configuration information for
the remote SMTP server.
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/se
ndusing") = 2
'Name or IP of Remote SMTP Server
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sm
tpserver") = "ns1.yahoo.com"
'Server port (typically 25)
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sm
tpserverport") = 25
objEmail.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objEmail.Send
End If
End If
End If
End If
End If
objRecordSet.MoveNext
Loop
' Clean up.
objConnection.Close
Wscript.Echo "Done"
Function Integer8Date(objDate, lngBias)
' Function to convert Integer8 (64-bit) value to a date,
adjusted for
' local time zone bias.
Dim lngAdjust, lngDate, lngHigh, lngLow
lngAdjust = lngBias
lngHigh = objDate.HighPart
lngLow = objdate.LowPart
' Account for bug in IADslargeInteger property methods.
If lngLow < 0 Then
lngHigh = lngHigh + 1
End If
If (lngHigh = 0) And (lngLow = 0) Then
lngAdjust = 0
End If
lngDate = #1/1/1601# + (((lngHigh * (2 ^ 32)) _
+ lngLow) / 600000000 - lngAdjust) / 1440
' Trap error if lngDate huge.
On Error Resume Next
Err.Clear
Integer8Date = CDate(lngDate)
If Err.Number <> 0 Then
Err.Clear
Integer8Date = #1/1/1601#
End If
On Error GoTo 0
End Function
User's email address is not the same as user NT name
(userid). For example, email address for user NT name
(Ian) will have an email address (icmpbell@yahoo.com). I
thought I maybe able to use Richard's script to call my
file "emails.txt" and be able to associate which email
address belong to that user NT name and then send a
notification to the user that his/her user NT name will
expired on this date. I apologize if I am not explaining
correctly.
Let say I have a file "emails.txt" containing
icmpbell@yahoo.com. A script will look into "emails.txt"
file and distinguished this email's address associated to
userid "Ian", then send an Email Notification to Ian that
his password will expired on November 28, 2003 at 10:38:06.
First, I will write a script using Richard's script to
output a file of ALL the userid that will expire within 10
days, then I have to manually produce "emails.txt" file,
unless someone know a script that can import those email
addresses to the rightful userid.
Do anybody know if my "emails.txt" may need to contain
both userid and email address in order for the script to
function? If so, how? Is it per line based on my sample
below.......
Ian
icmpbell@yahoo.com
Or do it need to be listed with a comma like this......
Ian, icmpbell@yahoo.com
Very appreciated for your time and willingness to assist
me.
Thank you,
Ian Campbell
Amature Developer Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146990
copy file
Hello,
I'm new to this, trying to make a copy of a file in the same folder as the
original but with a new name. I've found that CopyFile doesn't work for the
same directory. And because of certain restrictions, sometimes the pathing
will be UNC, so I can't shell out & use the command line 'copy' command.
Is my only option some kind of file-copy to a new directory, file-rename,
file-move back? These are binary files, so I haven't tried using the
createfile methods - should those work?
TIA.
-Dave Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146987
Creating users, and their home directory
Hi All,
I have a list of 90 users that I need to import into AD. I wrote a script
that does this but it doesn't create their home folder automatically. So
for instance, if I set the user's home folder to \\servername\share\folder,
and set it to a Z drive or something, that folder is not created. However,
when I manually create, or copy a user, it does create that folder
automatically (with the appropriate permissions etc.). Is there an easy way
to get it to create that home folder automatically, without having to make
the script do all of that work? Maybe a copy of an existing user? There is
an article on MSDN about copying a user, but only for SELECTED attributes.
I want ALL of the attributes copied (except username of course).
Thanks,
Pair Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146984
Display Status Window with Wsh Logon Script
I have a simple yet successful logon vbscript for windows 2000.
However, i would like to display the results/progress in a status
window at runtime when a user log's on to his/her pc. I have seen some
scripts using ie documents but most of the script I have found is a
football field long and does not work with my script. Can somebody
post or refer me to simple code that only displays the results and
status of what is happening (i.e. like in batch files)? Nothing fancy,
just straight forward code that works?
Thanks much! Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146972
Disable Keyboard & mouse
Dear all
i would like to disable the funtion of keyboard & mouse during my script is
running so that the user could not change the focus of the running program.
can anyone tell me how to write it???
i've search the microsoft, msdn & google but nothing can help.
thank you all in advanced.
: ) Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146969
Possible to search PST files with VBS?
Is it possible to search a series of PST files with VBS for a
perticular string?
will GetObject work on a PST file? Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146963
InStr - Searching Logs for strings? Any help?
Wondering if someone can show me a working example of the InStr
function.
I'd like to seach a log file on various remote servers for successful
exit codes.
the examples i've tried recently only work if the string is exactly
For example the log file with a line like
11:11:54 11/01/2003 033867563 RADCONCT EXIT STATUS = [857]
I can get InStr to work if I enter all that exactly but not if I'm
only searching for RADCONCT EXIT STATUS = [857]
Thanks Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146961
authentification
Hello,
we have subscribed to a web site that need a user/password IIS
authentification every time you connect to it.
I'm looking for a script that will make the connexion automatically (by
filling the 'user/password' field)
thanx for any help and idea.
Nova Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146958
Using VBScript to run Find in Excel
I would like to use VBScript to find a value that is a variable in
Excel. I assign WSval as the variable to hold the data I need to
locate in column 1 of my Excel file. The problem is in my Do Loop
where I say "If val = (WSval) Then". I don't think val is being
compared to the actual data WSval is holding but rather the word
WSval. My code looks like this:
On Error Resume Next
Const ForReading = 1
Const TristateFalse = 0 'Opens the file in ASCII format
Dim wshShell
Set wshShell=CreateObject("Wscript.Shell")
Set oFS = CreateObject("Scripting.FileSystemObject")
oFS.DeleteFile "N:\pardus\pingresults.txt", True
tIP=InputBox("Enter the IP address: xxx.xxx.xxx.xxx")
wshShell.run ("cmd ~")
Wscript.Sleep 500
wshShell.SendKeys "ping -a " & tIP & ">N:\Pardus\ping.txt ~"
Wscript.Sleep 4000
wshShell.SendKeys "Exit ~"
aFile = "N:\Pardus\ping.txt"
Set f = oFS.OpenTextFile(aFile, ForReading, True)
f.SkipLine
f.Skip(10)
WSval = f.Read(4)
'RUN QUERY AND SEARCH FOR MATCHING WS NUMBER
Set xl = CreateObject("Excel.Application")
xFile = "I:\My Documents\databases\queries\Query from Trackit.dqy"
xl.WorkBooks.Open xFile
xl.Visible=True
xl.DisplayAlerts = False 'Prevents prompt about overwriting resume.xlw
WScript.Echo "Read from text file " & WSval
r = 1 'row
c = 1 'column
Set oSheet = xl.ActiveWorkbook.Worksheets(1)
oSheet.Select
Do
val = oSheet.Cells(r,c).Value
WScript.Echo "Read from Excel file " & val
If val = (WSval) Then
WScript.Echo val
xl.Application.Quit
Exit Do
Else
r = r + 1
End If
Loop
Thanks in advanced for any suggestion/help!
Steve Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146957
users and folders
I need to write/find a script that will bulk import
around 1500 users creating users and home drives on a
windows 2003 server.
Any help would be welcome Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146956
Timer before continue with script
Hi
Is it possible to have a timer in a "while not rsResults.EOF"
I want to wait 1 second before returning the next record from that statement
above.
What would the code look like in asp?
Thanks Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146953
An easier way to write this code?
Is there an easier/shorter way to write this code?
Test1 = Request.Form("Test1")
Test2 = Request.Form("Test2")
Test3 = Request.Form("Test3")
Test4 = Request.Form("Test4")
if Test4 = "Yes" and Test3 = "Yes" and Test2 = "Yes" and Test1 = "Yes" then
Result = 5
elseif Test4 = "Yes" and Test3 = "Yes" and Test1 = "Yes" then
Result = 5
elseif Test4 = "Yes" and Test2 = "Yes" and Test1 = "Yes" then
Result = 5
elseif Test4 = "Yes" and Test1 = "Yes" then
Result = 5
elseif Test3 = "Yes" and Test2 = "Yes" and Test1 = "Yes" then
Result = 4
elseif Test3 = "Yes" and Test1 = "Yes" then
Result = 4
elseif Test3 = "Yes" then
Result = 4
elseif Test2 = "Yes" and Test1 = "Yes" then
Result = 3
elseif Test2 = "Yes" and Test1 = "No" then
Result = 1
elseif Test4 = "No" and Test3 = "No" and Test2 = "No" and Test1 = "Yes" then
Result = 2
elseif Test1 = "No" then
Result = 0
end if Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146941
Best way to enumerate installed applications
Hi there,
How can I list the applications installed on Win98 machines...? The list
displayed by Add/Remove programs would be a good start... anyone know how to
get this? I'd preferably like to know the executable path and name as well
as the application friendly name.
Any other suggestions for auditing PC software...?
Note that this is preliminary work in preperation for implementing SMS
Server 2003 so no point suggesting I use a server based tool like SMS...
Cheers Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146938
scrolling popups
Hi,
Does anyone know how to set the scroll
attribute on a popup. For instance if I
write this:
set p=window.createpopup
p.document.body.scroll="yes"
p.show 0,0,100,100
I don't see any scroll bars. I know a popup
can have scroll bars because if I write it
this way I not only see scroll bars but a
sunken border as well:
set p=window.createpopup
p.document.write "x"
p.show 0,0,100,100
? Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146936
vbs send at commands to serial port
I am trying to write a visual basic script that will be
able to send "at-commands" to the serial port.
I found all commands for the gsm-modem to send sms, but I
am still looking for a way to send the commands. I have
tried to use the mscomm32.ocx through an object, but
without success.
Any help? Tag: RE: Use this corrective package for Microsoft Internet Explorer Tag: 146912
Bulk change of AD Remote Access permission attrib
Hi,
Trying to do a bulk change of the AD attribute for RAS Permission from
"Deny" to "Allow". Have looked up the Technet script centre on this and
have come up with:
Set objUser = Get Object ("LDAP://cn= etc...correct LDAP path)
objUser.Put "msNPAllowDialin", TRUE
objUser.SetInfo
While this changes this particular attribute as seen in ADSI Edit, it does
not change the AD Users and Computers user account "Dial In" tab attributes
at all. I have no need for any of the other attributes mentioned in the
script centre article and do not want them set. Manually changing the
"Dial In" tab to "All