trying to achieve automation, need assistance
I have created a deployment script to automate desktop deployment. I have
enabled autologon using the local administrator account... But I am trying to
figure out the best way to get the script to run at startup...
Now, I know vbscript has a GPO interface but I have no idea how I would
disable the deployment.vbs script from running at logon. I could put the
script in the startup folder, but how would I remove it automatically? I
couldn't delete the script while the script is running could i?
Any thoughts? Tag: time synchronizer Tag: 182798
DateAdd Bug?
Small VBS to demonstrate an issue I have with the VBS DateAdd function:
msgbox CDate("23/10/2005 22:15:00") = DateAdd("h", 22, DateAdd("n", 15,
CDate("23/10/2005")))
This pops up a message box with False in it.
Any suggestion as to why?
This returns true:
msgbox CDate("23/10/2005 22:15:00") = CDate(CStr(DateAdd("h", 22,
DateAdd("n", 15, CDate("23/10/2005")))
(UK Locale!) Tag: time synchronizer Tag: 182793
70 permission denied in upload file
I have a web application in asp that have to upload files.
If I put the upload directory into C:\ directory I have no problem, but
if I put it into the C:\InetPub\wwwroot directory it give me the error
in the subject.
I've set all the permissions on the upload directory (read, write,
execute, ecc.) and also on the wwwroot directory, but evidently there is
some permission that stop the writing of the uploaded file.
I've also attempt to share the directory both as web share that as net
share, but nothing to do.
I have Win XP with IIS 5.1.
Someone can help me?
Thanks
Tonio Tanzi Tag: time synchronizer Tag: 182792
sending an email of log file that is created in new folder each time
Hello,
I am new to this forum and to scripting, and was hoping I could find
some help.
I want to email off a log file that is created each week. It puts the
report into the following path (and the html log file name is always
random):
c:\Nov2005\Week1\log0011029273.html
The month and week folders are created new each week, so I cant use a
static file location.
I have the following script that works fine for static files:
--------------------------------------------
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.Sender = "sc@co.com"
objMessage.To = "sc@co.com"
objMessage.TextBody = "This is some sample message text."
objMessage.AddAttachment "c:\Nov2005\Week1\log0011029273.html"
'==This section provides the configuration information for the remote
SMTP server.
'==Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"mail.co.com"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objMessage.Send
-----------------------------------------------------------
..but every time this report is run, it creates a new path to the new
report file...so this has to be the current
C:\month\week\randomlogfilename.html
Any help in constructing this would be much appreciated.
--
sc48226
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------ Tag: time synchronizer Tag: 182785
error connecting to Active Directory via LDAP from ASP/VBScript pg
I'm rather new to the world of VBScript/ASP. I'm a *nix-head and have
been programming in PHP for years. I'm rather frustrated because I do
not know how to go about trouble-shooting an error I'm receiving in a
script I'm trying to implement to authenticate a user against AD.
The script is as follows (found it in these usenet groups):
<%@ Language=VBScript %>
<%
Dim username, password, ldapserver, ldap_path
' Construct the FQDN
ldap_path = "LDAP://cn=##,DC=ourcollege,DC=edu"
' Get the ldap server name into local variable by replacing the special
' charcter with the username
ldapserver = Replace(ldap_path,"##",Request.Form("username"))
Response.Write("<b>username:</b> " & Request.Form("username") & "<br
/>")
Response.Write("<b>ldapserver:</b> " & ldapserver & "<br />")
' Parse the username from the ldap path
username = Mid(ldapserver, InStr(8, ldapserver, "/") + 1)
Response.Write("<b>username:</b> " & username & "<br />")
' Get the password
Password = Request.Form("Password")
' Connect to the LDAP Directory
Set dso = GetObject("LDAP:")
' Validate the User Name and Password
Set objUser = dso.OpenDSObject(ldapserver, username, password, 0)
'Response.Write("<b>lobjuser.class:</b> " & lobjUser.class & "<br />")
'Response.Write("<b>err.description:</b> " & err.description & "<br
/>")
' Exit with error - Incorrect username & password - return to login.asp
page
'If Err.number<>0 Then
' Response.Write "<b>Result:</b> Authentication Failure.<br />"
' Set lobjUser = nothing
' Set dso = nothing
'Else
' Response.Write "<b>Result:</b> Success.<br />"
'End If
'To get information from the LDAP directory you need to know the
"attributes"
'available and then you can reference them. Ex:
'strUserName = lobjUser.Get("cn")>
%>
The above code generates the very unhelpful error:
error '8007054b'
/ldap_auth_02.asp, line 29
Is there a system log which will give me more information on the error
which occured? Is there something I can response.write to my browser
which might give me a more useful error message?
I recently put together a PHP script to connect to AD via LDAP. I had
to bind to AD using a username (RDN?) and password before I could
perform a query. (I apologize if I'm not using the appropriate
terminology.) I then passed AD our Base DN, filter, and search terms.
I can't find any documentation on this. My ultimate goal is to
authenticate a user with their AD credentials. Tag: time synchronizer Tag: 182783
SCSI Adapter Port Number
Hi,
Anyone know how to get the SCSI port number of a SCSI host adapter using
vbscript?
I can get the SCSIPort property of a disk object using WMI but there doesn't
seem to be a port number property for the HBA.
Please let me know if you would like more information,
Much appreciated,
Joe Marriott Tag: time synchronizer Tag: 182782
Hide/Show HTML Elements
Hi, I would like to show a status label above all other HTML elements
when a certain function is fired. (for example: "Calculating..."
I tried playing with .zIndex, .Display="none" and .Visible properties
but none of the seem to be working for [web forms label] or Iframe (I
use IFRAME to show label above ActiveX control)
What is the easiest way for me to show hide information/status labels
on a web form?
document.getElementById("lblInfo").????
Thank you,
Sergey Tag: time synchronizer Tag: 182778
Server.CreateObject Excel permissions
Hello All
I am trying to port some ASP code over to a windows 2003 server.
It works fine on my "dev" windows 2000 server.
I get this error on the 2003 server:
Error Type:
Server object, ASP 0178 (0x80070005)
The call to Server.CreateObject failed while checking permissions. Access is
denied to this object.
Here is the line of code associated with the error:
set objExcel = Server.CreateObject("Excel.Application")
I have Excel 2000 installed on both machines.
From what I can tell I have set permissions the same on both machines.
I set and checked the permissions on the actually Excel.exe file is that the
correct file that CreateObject uses? What else should I be checking/setting
permissions on so that this will work on the 2003 server?
Thanks in advance.
Adam Tag: time synchronizer Tag: 182776
VBS to .net
I just started working with .net and I'm wanting to know how hard it is
to convert a .vbs to .net? The scirpt is a basic script that is 2
msgboxes and requires input from the user on both promts then it copies
the results to the clipboard. Tag: time synchronizer Tag: 182775
Query for Patches Applied
I need a query that will run and send to text all of the patches applied to a
server or workstation. I have one now, however, it doesn't give me the full
history like when you click on history on the windows update site. And it
does not tell me that XP SP2 was installed, when it actually was.
I can share the code to my current script if needed.
Thanks! Tag: time synchronizer Tag: 182774
check membershipt to group using input boxes. Isn't binding corre
strFilePath = "c:\test.txt"
errorlog = "c:\error.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objtextFile = objFSO.OpenTextFile (strFilePath)
Set objFile = objFSO.CreateTextFile(errorlog, True)
' On Error Resume Next ' moved this out of the Do loop
objgroup = inputbox("Type group here")
objuser = inputbox("type local user here")
Do Until objtextFile.AtEndOfStream
Set grp = GetObject("WinNT://" & strcomputer & "/" & objgroup & ",group")
Set usr = GetObject("WinNT://" & strcomputer & "/" & objuser & ",user")
strComputer = Trim(objtextFile.ReadLine)
if len(strComputer) <> 0 then
If (grp.IsMember(usr.name)) Then
objFile.Writeline now & " user " &objuser & " is member of " &
objgroup & " on " & strComputer
Else
objFile.Writeline now & " user " & objuser & " isn't member of " &
objgroup & " on " & strComputer
End If
err.clear
end if
loop
objFile.Close
objTextFile.close
result = objfso.OpenTextFile(errorlog, 1).ReadAll
wscript.echo result Tag: time synchronizer Tag: 182772
Startup script, alternative to %LogonServer%?
I wish to copy a file from the Netlogon share within a startup script,
however, I cannot use the %LogonServer% variable in a startup script (not
logon script). Is there an equivilant variable? I could specify a specific
DC, but as we have a number of sites I would prefer using the DC server that
it is running the script from.
Windows Server 2003 SP1
Windows XP Professional SP2 Tag: time synchronizer Tag: 182759
Copy file
Hi all
I have a script that maps a network share and then copyies a file from this
share down to the desktop. Instead of copying to the desktop I would like to
copy to mapped share. (G:\Database)
This is the script I have:
Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "x:", "\\Server1\Share1"
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("scripting.FileSystemObject")
sAllUsersDesktop = oShell.SpecialFolders("AllUsersDesktop")
oFSO.CopyFile "X:\DB\DB1", sAllUsersDesktop & "\", True
I would like to chage it so instead of copying to the Desktop, it copies to
G:\Database
Thanks
Gerry Tag: time synchronizer Tag: 182751
net send message alternatives?
Hello,
I need a script to send real-time notifications to users. I wanted to wrap
a vbScript around "net send [user] [message]" but that may not be possible
in our environment.
Other than a 3rd party tool, is this possible?
Troy Tag: time synchronizer Tag: 182735
Character match
I want to match character sets to last names of users. Can someone please
help me with the correct syntax:
I.e.
if lastName = [A-Bea] then 'I want this to match names beginning with A to
last names that start with Bea.
...
elseif lastName = [Beb-M] 'Names that begin with Beb all the way to names
that begin with M
...
else 'All other last names.
...
Thanks. Tag: time synchronizer Tag: 182731
TextFile Replace
I am looking for a script that I can open a text file and search for a
string and replace it with another string.
set wf1 = fso.OpenTextFile("c:\HOME\computers.txt", ForReading, true)
Do While Not wf1.AtEndOfStream
Set RegX = NEW RegExp
MyString = wf1.readline
SearchPattern = "$Group Name$"
ReplaceString = gname
RegX.Pattern = SearchPattern
RegX.Global = True
ReplacedText = RegX.Replace(MyString, ReplaceString)
loop
wf1.close
This doesn't work above, I don't receive any errors, however, it doesn't
change the text to gName (is another variable that is set earlier in the
code).
Any assistance that can be provided is much appreciated. Tag: time synchronizer Tag: 182730
Adding Users to local computers
I need to add users to a local computer in our domain. We have a password
complexity policy stating that the password must be 5 characters.
When I run the following bit of code I get an error which is:
-2147022651 The password does not meet the password policy requirements.
Check the minimum password length, password complexity and
password history requirements.
If I run this same code on a computer that doesn't have password complexity
requirements it adds the user fine.
sName = "Testserver"
sUsername = "Administrator"
sUserPassword = "*********"
sUser = "PatchUser"
sNewAccountPassword = "!a2b3c4z"
Set objDSO = GetObject("WinNT:")
Set objComputer = objDSO.OpenDSObject("WinNT://" & sName, sUserName,
sUserPassword, 3)
Set objUser = objComputer.Create("user", sUser)
objUser.Description = "New Test Account Created on " & Now
objUser.SetPassword sNewAccountPassword 'Added to try to set password
prior to writing to local account db.
objUser.SetInfo
objUser.SetPassword sNewAccountPassword
objUser.SetInfo Tag: time synchronizer Tag: 182728
Empty Recycle Bin
I am trying to find a VBScript that will empty the recycle bin on Windows
2000 Servers and 2003 Servers. A friend found the following script but when I
run it I get an "expected end of statement" error. Does anyone have a simple
script that I can use or tell me what is run with this:
Private Const SHERB_NOCONFIRMATION = &H1
Private Const SHERB_NOPROGRESSUI = &H2
Private Const SHERB_NOSOUND = &H4
Private Declare Function SHEmptyRecycleBin Lib "shell32.dll" _
Alias "SHEmptyRecycleBinA" (ByVal hwnd As Long, _
ByVal pszRootPath As String, ByVal dwFlags As Long) As Long
Private Sub EmptyRecycleBin()
Call SHEmptyRecycleBin(Me.hwnd, vbNullString, _
SHERB_NOCONFIRMATION Or _
SHERB_NOPROGRESSUI Or _
SHERB_NOSOUND)
End Sub
Thank You Tag: time synchronizer Tag: 182726
split recordset in array
Hi
I am trying to split my recordset and found bit problem, hope someone
can help me out
below is my code:
data = "help desk,student coordinator,pc support"
msgbox data
varArr = Split(data, ",")
For group = LBound(varArr) To UBound(varArr)
msgbox group
Next
I want them to return like
Help desk
student coordinator
pc support
so far, it return
0
1
2
Any helps thank in advance
Wei Tag: time synchronizer Tag: 182723
window.setInterval with negative delay time - Windows XP SP1 & SP2
Hello all,
I have noticed (but haven't really proven) that setting the delay time
in the window.setInterval function to -1 (or any negative value) has
different effect on client machines with Windows XP SP1 versus SP2.
window.setInterval( "AsyncUpdate();", -1 );
For Windows XP with SP2, it is working as expected (i.e. the timer is
treated as if it's turned OFF). However with SP1, I suspected that the
function behaves oppositely, i.e. the function within the timer gets
called continuously and indefinitely, creating an endless loop and an
extremely heavy load on the CPU.
If anybody has experienced this same problem, please contribute to this
thread.
Thank you and happy programming!
Lyndsey Tag: time synchronizer Tag: 182722
image tag pointing to an ASP page (not working)
Hi,
i have 2 IIS Servers: IIS1 and IIS2
IIS1 hosts a page called http://www.mydomain.com/page1.asp
IIS2 hosts an ASP page called http://www.mydomain2.com/page2.asp
On the page2.asp on IIS2, the code basically retrieves the ID value shown in
the example below.
WHen page1 loads, it has a parameter called ID
(http://www.mydomain.com/page1.asp?ID=1).
Page1.asp on IIS1 has an image tag that points the src attribute to
http://www.mydomain2.com/page2.asp?ID=1.
I can't seem to retrive the values on page2 on IIS2.
any ideas?
please advise.
rafael Tag: time synchronizer Tag: 182720
Checking for a Folder on a remote computer
I'm new to scripting but here goes. I have check for a folder on a remote
computer and if it's not there create it. I would like it to report back to
me if it is there are not. The script I've got so far works but the reporting
doesn't. Can anyone give me a hand?
strComputer = "computer"
strNameSpace = "root/cimv2"
strUser = "domain\user"
strPwd = "password"
strDirPath = "C:\itworks"
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objService = objLocator.ConnectServer(strComputer,
strNamespace,strUser,strPwd)
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(strDirPath) Then
Wscript.Echo "The folder exists."
Else
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")
errReturn = objWMIService.Create _
("cmd.exe /c md "& strDirPath, Null, Null, intProcessID)
Wscript.Echo "The folder was created."
End If
Mark
P.S. Later I would like to have the script copy files from a server to the
remote computer. Any ideas would be a great help. Tag: time synchronizer Tag: 182716
how to create computer accounts
is it possible to script the creation of computer accounts in a given domain
when the machine running the script is not apart of a domain? Tag: time synchronizer Tag: 182713
database problems
Hi all
I have a sql database with some col headings like sxtnmm_proj , slide_proj
which i asign values to like 0 or 1.
What i want to do is is create a record set using ASP and write out the col
headings where the value is 1, but instead of writting out for instance
slide_proj you would get the word slide projector, i know these would have
to stored in an array some how.
Can anybody shed any light on this query
thanks in advance
Dave Tag: time synchronizer Tag: 182711
Writing a login script........
Our co. is moving from Novell to AD and currently in the process of
planning.
Any PRO's out there have tips on the most efficient way to write a
login script.........
I've looked around and seem some that use the "IsMember" to check group
membership, but that'll involve hardcoding the drive mapping for that
group into the script.
Any other suggested ways of writing a login script that will have less
maintenance if future changes in mappings are required since our co.
has a few thousand users I'd expect there be several drive mappings for
each users.
Or any good sites out there that have sample logon scripts
Cheeers
Momo Tag: time synchronizer Tag: 182709
Help me edit this remote registry script
This script goes remote to all computers found in c:\computerlist.txt
and checks memoryconfiguration and exports it to CompInfoLog.txt.
Instead of memoryconfig, I would like to check the registry for a
specific stringvalue, and export that value to a txt file,
Script:
Const ForReading = 1
Const OpenAsASCII = 0
Const FailIfNotExist = 0
Const OverwriteIfExist = -1
strInFile = "C:\ComputerList.txt"
strOutFile = "C:\CompInfoLog.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strInFile, _
ForReading, FailIfNotExist, OpenAsASCII)
Set objOutputFile = objFSO.CreateTextFile _
(strOutFile, OverwriteIfExist, OpenAsASCII)
objOutputFile.WriteLine "Note: all memory amounts are in kilobytes" &
vbCrLf
Do Until objFile.AtEndOfStream
strComputer = Trim(objFile.ReadLine)
If strComputer <> "" Then
objOutputFile.WriteLine String(40,"=") & vbCrLf
If IsConnectible(strComputer, 1, "") Then
On Error Resume Next
Set objWMI = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer _
& "\root\cimv2")
Set colCS = objWMI.ExecQuery("Select Model from
Win32_ComputerSystem")
For Each objCSItem In colCS
Set objCS = objCSItem :Exit For
Next
Set colOSSet = objWMI.ExecQuery("Select * from
Win32_OperatingSystem")
For Each objOS In colOSSet
Set objOS = objOS :Exit For
Next
If Err.Number = 0 Then
s = ""
s = s & "Computer name: " & strComputer & vbCrLf
s = s & "Computer model: " & objCS.Model & vbCrLf
s = s & "FreePhysicalMemory = " & objOS.FreePhysicalMemory &
vbCrLf
s = s & "FreeSpaceInPagingFiles = " &
objOS.FreeSpaceInPagingFiles _
& vbCrLf
s = s & "FreeVirtualMemory = " & objOS.FreeVirtualMemory &
vbCrLf
s = s & "TotalVirtualMemorySize = " &
objOS.TotalVirtualMemorySize _
& vbCrLf
s = s & "TotalVisibleMemorySize = " &
objOS.TotalVisibleMemorySize _
& vbCrLf
objOutputFile.WriteLine s
Else
objOutputFile.WriteLine strComputer & " failed WMI
connection." _
& vbCrLf
End If
Else
objOutputFile.WriteLine strComputer & " did not reply on ping."
_
& vbCrLf
End If
End If
Loop
objFile.Close
objOutputFile.Close
MsgBox "Done!", vbInformation + vbSystemModal, "Get computer info"
Function IsConnectible(sHost, iPings, iTO)
' Returns True or False based on the output from ping.exe
'
' Author: Alex Angelopoulos/Torgeir Bakken
' Works an "all" WSH versions
' sHost is a hostname or IP
' iPings is number of ping attempts
' iTO is timeout in milliseconds
' if values are set to "", then defaults below used
Const OpenAsASCII = 0
Const FailIfNotExist = 0
Const ForReading = 1
Dim oShell, oFSO, sTempFile, fFile
If iPings = "" Then iPings = 2
If iTO = "" Then iTO = 750
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sTempFile = oFSO.GetSpecialFolder(2).ShortPath & "\" &
oFSO.GetTempName
oShell.Run "%comspec% /c ping.exe -n " & iPings & " -w " & iTO _
& " " & sHost & ">" & sTempFile, 0 , True
Set fFile = oFSO.OpenTextFile(sTempFile, ForReading, _
FailIfNotExist, OpenAsASCII)
sResults = fFile.ReadAll
fFile.Close
oFSO.DeleteFile(sTempFile)
IsConnectible = CBool(InStr(sResults, "TTL="))
End Function
'--------------------8<---------------------- Tag: time synchronizer Tag: 182707
include files
Hi again :)
I am doing a web application and I have a little problem.
In Javascript I have something like <script languaje="javascript"
src="my_file.js"> </script>
But it doesn't work with vbscript :(
How I can do it?
Thanks you very much from Mallorca
Fernando Tag: time synchronizer Tag: 182704
output redirection doesn't work
I would like to filter the output of a command-line program (like "telnet")
to change parts of the output (replace certain strings with others).
To write routines to recognize the strings I want to replace is not a
problem, but I could not manage to redirect the output in a way, so I can
filter it.
The best redirection possibility I could find is the following for filtering
the output of a "normal" command (in this case the "ver" command):
ver | cscript.exe "c:\my path\muscript.vbs"
'=== myscript.vbs ===
set stdin = wscript.stdin
for each line in split(stdin.readall,vbcrlf)
wscript.echo "==>", line
next
It was published by Michael Harris in http://www.ureader.com/message/483292.
aspx, and this works nice with "normal" commands, but when I try to do it
with the telnet-command, I just get the next line of the command-interpreter
- no error-message, nothing, it just doesn't start telnet.
I tried:
telnet 192.168.0.1 | cscript.exe "c:\my path\myscript.vbs"
==> but it doesn't do the telnet
Does anyone know, why the telnet-program is not being started, or how I can
filter the output of a telnet-session?
I am using the standard telnet-client of Windows XP.
Thanks in advance,
Mike Tag: time synchronizer Tag: 182701
Problem in open a new window in an asp page
Hi to all,
I have to do an asp page with a form. When an user fill the data in the
form and press a submit button is executed a validation of the data in
the same page and, if they are correct, is showed a PDF document in a
separated window.
I've done it in this manner:
<%@Language=VBScript%>
<%
:
:
Validation instructions
:
:
if validation is ok then checkok=true
%>
<HTML>
<HEAD>
<script type="text/javascript">
function winop(url) {
window.open(url,"","width=600,height=600");
}
//-->
</script>
</HEAD>
<% if checkok then %>
<body onload="winop('showpdf.htm');">
<% else %>
<body>
<% end if %>
<form action="url of this page" method="post">
a sequence of input text plus a submit button
</form>
</body>
</HTML>
This solution don't work in IE6.0 (popup block disabled), but work in
other browser (Mozilla, Firefox, Opera).
The problem is in the onload clause of body tag that don't open the new
window.
In fact if I call the winop function in the onclick event of the button
it go without problem (but in this case the validation of data is not
performed).
Someone knows a better solution providing that I prefer to avoid the
previous one because it don't go if the popup block is activated.
Thanks to all.
Tonio Tanzi Tag: time synchronizer Tag: 182700
POST Method form
Dear Experts,
I wrote a program to send a HTML form to be emailed to users. Users will
input the answer into the form and click Submit button. I am using the POST
method and calling another asp page.
Here is the source code of the form:
<HTML><BODY><FORM Name='frmReminderReport' METHOD='Post'
action='c:\inetpub\wwwroot\teknion\leave_system\ReminderReport.asp'><TABLE
Border=1><TR><TD>Supervisor</TD><TD>30852</TD></TR><TR><TD>LeaveID</TD><TD>EmployeeID</TD><TD>Name</TD><TD>StartD
ate</TD><TD>EndDate</TD><TD>Period</TD><TD>Total
Day(s)</TD><TD>Accept</TD><TD>Reject</TD><TR><TR><TD><INPUT
Type=text name=leaveid1 value=2050></INPUT></TD><TD>30217</TD><TD>SUTHAGAR
A/L SEGARAN</TD><TD>
31-Oct-05</TD><TD>02-Nov-05</TD><TD>FULL DAY</TD><TD>2</TD><TD><INPUT
Type=Checkbox name=accept1
></INPUT></TD><TD><INPUT Type=Checkbox name=reject1 ></INPUT></TD></TR><input type='hidden' name='Counter'
value=1></input></TABLE><input value='Submit' type='submit' id='submit'
name='submit'></input></FORM></BODY></HTML>
and below is the ReminderReport.asp code:
<%@ LANGUAGE="VBSCRIPT" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Reminder Report</title>
</head>
<body>
<%
Response.Write "The Counter is " & Request.Form('Counter')
%>
</body>
</html>
Once I click on the submit button, the ReminderReport.asp page does open but
the output does not show on the page. May I know where is the problem of my
coding??
Please advise. Many thanks in advance. Tag: time synchronizer Tag: 182699
problem running wmi query...
Hi all,
I need to get all errors from application and system categories of
event viewer but I see that the query below also traps warning events.
Any suggestions ?
Thanks and Regards.
strWQL = "SELECT * FROM __InstanceCreationEvent WITHIN 15 WHERE
TargetInstance ISA 'Win32_NTLogEvent'" & _
"AND TargetInstance.Type = 'Error' AND TargetInstance.LogFile =
'Application' OR targetinstance.logfile='system'" Tag: time synchronizer Tag: 182689
Drive Mapping, No Error, but No Mapping Happens
Title says it; I get no error, but existing mappings don't go away, and new
mappings don't happen. Any help is appreciated.
'start of script
Option Explicit
'FIRST, make sure we are logged in
wscript.sleep 100 '1.10th of a second
'NEXT remove existing mappings
dim objNetRemv, strDriveLetter, colDrives
On Error Resume Next
Set objNetRemv = CreateObject("Wscript.Network")
Set colDrives = objNetRemv.EnumNetworkDrives
For i = 0 to colDrives.Count-1 Step 2
objNetRemv.RemoveNetworkDrive colDrives.Item(i),0,TRUE
Next
'NOW map the drives
Dim strGroup
Dim objNetwork
Dim currentuser
Dim objUser
Const DTAdmins = "cn=SG-DeskTops-Administrators"
Const Accounting = "cn=SG-DPT-ACCOUINTING"
Const Engineering = "cn=SG-Dpt-Engineering"
Const HR = "cn=SG-Dpt-Human_Resources"
Const MFG = "cn=SG-Dpt-Manufactoring"
Const Marketing = "cn=SG-Dpt-Marketing"
Const Purchasing = "cn=SG-Dpt-Purchasing"
Const QC = "cn=SG-Dpt-Quality_Control"
Const Sales = "cn=SG-Dpt-Sales"
Const EA ="cn=enterprise admins"
'Const Managers_Group = "cn=managers"
'Const What_ever_you_Like = "cn=any_lower_case_group"
'Const Users_Group = "cn=users"
'Const Administrators_Group = "cn=administrators"
Set objNetwork = CreateObject("WScript.Network")
Set objUser = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & objUser.UserName)
strGroup = LCase(Join(CurrentUser.MemberOf))
WScript.Echo "all defined"
WScript.Echo strGroup
If InStr(strGroup, DTAdmins) Then
WScript.Echo "You are logged into the Desktop Desktop Administrators'Group
"
objNetwork.MapNetworkDrive "E:", "\\01SERVER\SYS\APPS ",0,TRUE
objNetwork.MapNetworkDrive "F:", "\\01SERVER\SYS",0,TRUE
objNetwork.MapNetworkDrive "G:", "\\01SERVER\SYS\GROUP\ACCT",0,TRUE
objNetwork.MapNetworkDrive "H:", "\\01SERVER\SYS\GROUP",0,TRUE
objNetwork.MapNetworkDrive "L:", "\\01SERVER\VOL1",0,TRUE
' objNetwork.MapNetworkDrive "I:", "\\01SERVER\SYS\USER\%USERNAME%",0,TRUE
objNetwork.MapNetworkDrive "Q:",
"\\ITTIND\.018035639281F1_SYS.CONOFLOW\GROUP\MFG\QA",0,TRUE
objNetwork.MapNetworkDrive "X:", "\\01SERVER\SYS\PBULIC\APPS",0,TRUE
objNetwrk.MapNetworkDrive "Y:", "\\01SERVER\SYS\PUBLIC\NLS",0,TRUE
objNetwork.MapNetworkDrive "Z:", "\\01SERVER\SYS\PUBLIC",0,TRUE
'objNetwork.MapNetworkDrive "v:", "\\olysbs\manager",0,TRUE
'objNetwork.MapNetworkDrive "w:", "\\olysbs\accounting",0,TRUE
'objNetwork.MapNetworkDrive "x:", "\\server\sprink slick",0,TRUE
'objNetwork.MapNetworkDrive "y:", "\\server\public",0,TRUE
'objNetwork.MapNetworkDrive "z:", "\\olysbs\Users\" _
'& objNetwork.UserName,0,TRUE
'COME BACK AND UNCOMMENT TO CREATE PRINTERS
'Dim net
'Set net = CreateObject("WScript.Network")
'net.AddWindowsPrinterConnection "\\olysbs\chris", "Chris's Printer"
'net.AddWindowsPrinterConnection "\\olysbs\frank", "Frank's Printer"
'net.AddWindowsPrinterConnection "\\olysbs\shop", "Shop Printer"
'net.AddWindowsPrinterConnection "\\olysbs\11x17", "11x17 Printer"
'net.AddWindowsPrinterConnection "\\olysbs\invoice1", "Main Invoice
Printer"
'net.AddWindowsPrinterConnection "\\olysbs\invoice2", "BU Invoice Printer"
'net.AddWindowsPrinterConnection "\\olysbs\office", "Main Office Printer"
'net.AddWindowsPrinterConnection "\\server\design east", "Design East"
'net.AddWindowsPrinterConnection "\\server\design east", "Design West"
'net.AddWindowsPrinterConnection "\\server\lee", "Lee's Printer"
'Removed the below line because if I log into another users workstation it
set this as default printer for them if one is not set
'net.SetDefaultPrinter "\\olysbs\chris"
End If
WScript.Echo "DTAdmins mapping done"
If InStr(strGroup, Accounting) Then
WScript.Echo " You are logged into the Accounting Group ",0,TRUE
objNetwork.MapNetworkDrive "E:", "\\01SERVER\SYS\APPS ",0,TRUE
objNetwork.MapNetworkDrive "F:", "\\01SERVER\SYS",0,TRUE
objNetwork.MapNetworkDrive "G:", "\\01SERVER\SYS\GROUP\ACCT",0,TRUE
objNetwork.MapNetworkDrive "L:", "\\01SERVER\VOL1",0,TRUE
objNetwork.MapNetworkDrive "O:", "\\01SERVER\SYS\GROUP\ACCT",0,TRUE
'COME BACK AND FIND SOURCE objNetwork.MapNetworkDrive "W:",
"\\01SERVER\SYS",0,TRUE
objNetwork.MapNetworkDrive "X:", "\\01SERVER\SYS\PBULIC\APPS",0,TRUE
objNetwork.MapNetworkDrive "Y:", "\\01SERVER\SYS\PUBLIC\NLS",0,TRUE
objNetwork.MapNetworkDrive "Z:", "\\01SERVER\SYS\PUBLIC",0,TRUE
'COME BACK AND UNCOMMENT TO CREATE PRINTERS
'Dim net
'Set net = CreateObject("WScript.Network")
'net.AddWindowsPrinterConnection "\\olysbs\chris", "Chris's Printer"
'net.AddWindowsPrinterConnection "\\olysbs\frank", "Frank's Printer"
'net.AddWindowsPrinterConnection "\\olysbs\shop", "Shop Printer"
'net.AddWindowsPrinterConnection "\\olysbs\11x17", "11x17 Printer"
'net.AddWindowsPrinterConnection "\\olysbs\invoice1", "Main Invoice
Printer"
'net.AddWindowsPrinterConnection "\\olysbs\invoice2", "BU Invoice Printer"
'net.AddWindowsPrinterConnection "\\olysbs\office", "Main Office Printer"
'net.AddWindowsPrinterConnection "\\server\design east", "Design East"
'net.AddWindowsPrinterConnection "\\server\design east", "Design West"
'net.AddWindowsPrinterConnection "\\server\lee", "Lee's Printer"
'Removed the below line because if I log into another users workstation it
set this as 'default printer for them if one is not set
'net.SetDefaultPrinter "\\olysbs\chris"
End If
WScript.Echo "Accounting mapping done"
If InStr(strGroup, Engineering) Then
WScript.Echo " You are logged into the Engineering Group "
objNetwork.MapNetworkDrive "E:", "\\01SERVER\SYS\APPS ",0,TRUE
objNetwork.MapNetworkDrive "F:", "\\01SERVER\SYS",0,TRUE
objNetwork.MapNetworkDrive "G:", "\\01SERVER\SYS\GROUP\ENG",0,TRUE
objNetwork.MapNetworkDrive "L:", "\\01SERVER\VOL1",0,TRUE
objNetwork.MapNetworkDrive "X:", "\\01SERVER\SYS\PUBLIC\APPS",0,TRUE
objNetwork.MapNetworkDrive "Y:", "\\01SERVER\SYS\PUBLIC\NLS",0,TRUE
objNetwork.MapNetworkDrive "Z:", "\\01SERVER\SYS\PUBLIC",0,TRUE
'COME BACK AND UNCOMMENT TO CREATE PRINTERS
'Dim net
'Set net = CreateObject("WScript.Network")
'net.AddWindowsPrinterConnection "\\olysbs\chris", "Chris's Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\frank", "Frank's Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\shop", "Shop Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\11x17", "11x17 Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\invoice1", "Main Invoice
Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\invoice2", "BU Invoice
Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\office", "Main Office
Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\server\design east", "Design
East",0,TRUE
'net.AddWindowsPrinterConnection "\\server\design east", "Design
West",0,TRUE
'net.AddWindowsPrinterConnection "\\server\lee", "Lee's Printer",0,TRUE
'Removed the below line because if I log into another users workstation it
set this as 'default printer for them if one is not set
'net.SetDefaultPrinter "\\olysbs\chris"
End If
WScript.Echo "Engineering mapping done"
If InStr(strGroup, HR) Then
WScript.Echo "You are logged into the Human Resources Group " & strGroup
objNetwork.MapNetworkDrive "E:", "\\01SERVER\SYS\APPS ",0,TRUE
objNetwork.MapNetworkDrive "F:", "\\01SERVER\SYS",0,TRUE
objNetwork.MapNetworkDrive "G:", "\\01SERVER\SYS\GROUP\HR",0,TRUE
objNetwork.MapNetworkDrive "H:", "\\01SERVER\SYS\GROUP",0,TRUE
objNetwork.MapNetworkDrive "L:", "\\01SERVER\VOL1",0,TRUE
objNetwork.MapNetworkDrive "X:", "\\01SERVER\SYS\PUBLIC\APPS",0,TRUE
objNetwork.MapNetworkDrive "Y:", "\\01SERVER\SYS\PUBLIC\NLS",0,TRUE
objNetwork.MapNetworkDrive "Z:", "\\01SERVER\SYS\PUBLIC",0,TRUE
'verify this when HR comes back
'COME BACK AND UNCOMMENT TO CREATE PRINTERS
'Dim net
'Set net = CreateObject("WScript.Network")
'net.AddWindowsPrinterConnection "\\olysbs\chris", "Chris's Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\frank", "Frank's Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\shop", "Shop Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\11x17", "11x17 Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\invoice1", "Main Invoice
Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\invoice2", "BU Invoice
Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\office", "Main Office
Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\server\design east", "Design
East",0,TRUE
'net.AddWindowsPrinterConnection "\\server\design east", "Design
West",0,TRUE
'net.AddWindowsPrinterConnection "\\server\lee", "Lee's Printer",0,TRUE
'Removed the below line because if I log into another users workstation it
set this as 'default printer for them if one is not set
'net.SetDefaultPrinter "\\olysbs\chris"
End If
WScript.Echo "HR mapping done"
If InStr(strGroup, MFG) Then
WScript.Echo "You are logged into the Manufacturing Group " & strGroup
objNetwork.MapNetworkDrive "E:", "\\01SERVER\SYS\APPS ",0,TRUE
objNetwork.MapNetworkDrive "F:", "\\01SERVER\SYS",0,TRUE
objNetwork.MapNetworkDrive "G:", "\\01SERVER\SYS\GROUP\MFG",0,TRUE
objNetwork.MapNetworkDrive "L:", "\\01SERVER\VOL1",0,TRUE
objNetwork.MapNetworkDrive "X:", "\\01SERVER\SYS\PUBLIC\APPS",0,TRUE
objNetwork.MapNetworkDrive "Y:", "\\01SERVER\SYS\PUBLIC\NLS",0,TRUE
objNetwork.MapNetworkDrive "Z:", "\\01SERVER\SYS\PUBLIC",0,TRUE
'COME BACK AND UNCOMMENT TO CREATE PRINTERS
'Dim net
'Set net = CreateObject("WScript.Network")
'net.AddWindowsPrinterConnection "\\olysbs\chris", "Chris's Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\frank", "Frank's Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\shop", "Shop Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\11x17", "11x17 Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\invoice1", "Main Invoice
Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\invoice2", "BU Invoice
Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\office", "Main Office
Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\server\design east", "Design
East",0,TRUE
'net.AddWindowsPrinterConnection "\\server\design east", "Design
West",0,TRUE
'net.AddWindowsPrinterConnection "\\server\lee", "Lee's Printer",0,TRUE
'Removed the below line because if I log into another users workstation it
set this as default printer for them if one is not set
'net.SetDefaultPrinter "\\olysbs\chris"
End If
WScript.Echo "MFG mapping done"
If InStr(strGroup, Marketing) Then
WScript.Echo "You are logged into the Marketing Group " & strGroup
objNetwork.MapNetworkDrive "E:", "\\01SERVER\SYS\APPS ",0,TRUE
objNetwork.MapNetworkDrive "F:", "\\01SERVER\SYS",0,TRUE
objNetwork.MapNetworkDrive "G:", "\\01SERVER\SYS\GROUP\MRKT",0,TRUE
objNetwork.MapNetworkDrive "L:", "\\01SERVER\VOL1",0,TRUE
objNetwork.MapNetworkDrive "X:", "\\01SERVER\SYS\PUBLIC\APPS",0,TRUE
objNetwork.MapNetworkDrive "Y:", "\\01SERVER\SYS\PUBLIC\NLS",0,TRUE
objNetwork.MapNetworkDrive "Z:", "\\01SERVER\SYS\PUBLIC",0,TRUE
'COME BACK AND UNCOMMENT TO CREATE PRINTERS
'Dim net
'Set net = CreateObject("WScript.Network")
'net.AddWindowsPrinterConnection "\\olysbs\chris", "Chris's Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\frank", "Frank's Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\shop", "Shop Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\11x17", "11x17 Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\invoice1", "Main Invoice
Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\invoice2", "BU Invoice
Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\olysbs\office", "Main Office
Printer",0,TRUE
'net.AddWindowsPrinterConnection "\\server\design east", "Design
East",0,TRUE
'net.AddWindowsPrinterConnection "\\server\design east", "Design
West",0,TRUE
'net.AddWindowsPrinterConnection "\\server\lee", "Lee's Printer",0,TRUE
'Removed the below line because if I log into another users workstation it
set this as default printer for them if one is not set
'net.SetDefaultPrinter "\\olysbs\chris"
End If
WScript.Echo "Marketing mapping done"
If InStr(strGroup, Purchasing) Then
WScript.Echo "You are logged into the Purchasing Group " & strGroup
objNetwork.MapNetworkDrive "E:", "\\01SERVER\SYS\APPS ",0,TRUE
objNetwork.MapNetworkDrive "F:", "\\01SERVER\SYS",0,TRUE
objNetwork.MapNetworkDrive "G:", "\\01SERVER\SYS\GROUP\MFG",0,TRUE
objNetwork.MapNetworkDrive "L:", "\\01SERVER\VOL1",0,TRUE
objNetwork.MapNetworkDrive "X:", "\\01SERVER\SYS\PUBLIC\APPS",0,TRUE
objNetwork.MapNetworkDrive "Y:", "\\01SERVER\SYS\PUBLIC\NLS",0,TRUE
objNetwork.MapNetworkDrive "Z:", "\\01SERVER\SYS\PUBLIC",0,TRUE
'COME BACK AND UNCOMMENT TO CREATE PRINTERS
'Dim net
'Set net = CreateObject("WScript.Network")
'net.AddWindowsPrinterConnection "\\olysbs\chris", "Chris's Printer"
'net.AddWindowsPrinterConnection "\\olysbs\frank", "Frank's Printer"
'net.AddWindowsPrinterConnection "\\olysbs\shop", "Shop Printer"
'net.AddWindowsPrinterConnection "\\olysbs\11x17", "11x17 Printer"
'net.AddWindowsPrinterConnection "\\olysbs\invoice1", "Main Invoice
Printer"
'net.AddWindowsPrinterConnection "\\olysbs\invoice2", "BU Invoice Printer"
'net.AddWindowsPrinterConnection "\\olysbs\office", "Main Office Printer"
'net.AddWindowsPrinterConnection "\\server\design east", "Design East"
'net.AddWindowsPrinterConnection "\\server\design east", "Design West"
'net.AddWindowsPrinterConnection "\\server\lee", "Lee's Printer"
'Removed the below line because if I log into another users workstation it
set this as 'default printer for them if one is not set
'net.SetDefaultPrinter "\\olysbs\chris"
End If
WScript.Echo "Purchasing mapping done"
If InStr(strGroup, QC) Then
WScript.Echo "You are logged into the Quality Control Group " & strGroup
objNetwork.MapNetworkDrive "E:", "\\01SERVER\SYS\APPS ",0,TRUE
objNetwork.MapNetworkDrive "F:", "\\01SERVER\SYS",0,TRUE
objNetwork.MapNetworkDrive "G:", "\\01SERVER\SYS\GROUP\MRKT",0,TRUE
objNetwork.MapNetworkDrive "L:", "\\01SERVER\VOL1",0,TRUE
objNetwork.MapNetworkDrive "Q:", "\\01SERVER\SYS\GROUP\MFG\QA",0,TRUE
objNetwork.MapNetworkDrive "X:", "\\01SERVER\SYS\PUBLIC\APPS",0,TRUE
objNetwork.MapNetworkDrive "Y:", "\\01SERVER\SYS\PUBLIC\NLS",0,TRUE
objNetwork.MapNetworkDrive "Z:", "\\01SERVER\SYS\PUBLIC",0,TRUE
'verify this when HR comes back
'COME BACK AND UNCOMMENT TO CREATE PRINTERS
'Dim net
'Set net = CreateObject("WScript.Network")
'net.AddWindowsPrinterConnection "\\olysbs\chris", "Chris's Printer"
'net.AddWindowsPrinterConnection "\\olysbs\frank", "Frank's Printer"
'net.AddWindowsPrinterConnection "\\olysbs\shop", "Shop Printer"
'net.AddWindowsPrinterConnection "\\olysbs\11x17", "11x17 Printer"
'net.AddWindowsPrinterConnection "\\olysbs\invoice1", "Main Invoice
Printer"
'net.AddWindowsPrinterConnection "\\olysbs\invoice2", "BU Invoice Printer"
'net.AddWindowsPrinterConnection "\\olysbs\office", "Main Office Printer"
'net.AddWindowsPrinterConnection "\\server\design east", "Design East"
'net.AddWindowsPrinterConnection "\\server\design east", "Design West"
'net.AddWindowsPrinterConnection "\\server\lee", "Lee's Printer"
'Removed the below line because if I log into another users workstation it
set this as 'default printer for them if one is not set
'net.SetDefaultPrinter "\\olysbs\chris"
End If
WScript.Echo "QC mapping done"
If InStr(strGroup, EA) Then
WScript.Echo "You are logged into the Sales Group " & strGroup
' objNetwork.MapNetworkDrive "E:", "\\01SERVER\SYS\APPS ",0,TRUE
' objNetwork.MapNetworkDrive "F:", "\\01SERVER\SYS",0,TRUE
' objNetwork.MapNetworkDrive "G:", "\\01SERVER\SYS\GROUP\SALES",0,TRUE
' objNetwork.MapNetworkDrive "L:", "\\01SERVER\VOL1",0,TRUE
' objNetwork.MapNetworkDrive "X:", "\\01SERVER\SYS\PUBLIC\APPS",0,TRUE
' objNetwork.MapNetworkDrive "Y:", "\\01SERVER\SYS\PUBLIC\NLS",0,TRUE
objNetwork.MapNetworkDrive "Z:", "\\Keeper\C",0,true
'COME BACK AND UNCOMMENT TO CREATE PRINTERS
'Dim net
'Set net = CreateObject("WScript.Network")
'net.AddWindowsPrinterConnection "\\olysbs\chris", "Chris's Printer"
'net.AddWindowsPrinterConnection "\\olysbs\frank", "Frank's Printer"
'net.AddWindowsPrinterConnection "\\olysbs\shop", "Shop Printer"
'net.AddWindowsPrinterConnection "\\olysbs\11x17", "11x17 Printer"
'net.AddWindowsPrinterConnection "\\olysbs\invoice1", "Main Invoice
Printer"
'net.AddWindowsPrinterConnection "\\olysbs\invoice2", "BU Invoice Printer"
'net.AddWindowsPrinterConnection "\\olysbs\office", "Main Office Printer"
'net.AddWindowsPrinterConnection "\\server\design east", "Design East"
'net.AddWindowsPrinterConnection "\\server\design east", "Design West"
'net.AddWindowsPrinterConnection "\\server\lee", "Lee's Printer"
'Removed the below line because if I log into another users workstation it
set this as 'default printer for them if one is not set
'net.SetDefaultPrinter "\\olysbs\chris"
End If
'Remove rem for shares to all users
'ElseIf InStr(strGroup, All_Users_Group) Then
'WScript.Echo "All Users Group " & strGroup
' objNetwork.MapNetworkDrive "h:", "\\Another Server\Users\" _
' & objNetwork.UserName
'End If Tag: time synchronizer Tag: 182688
best practices
Hi,
whats the best practices for managing scripts?
do you guys make use of .wsf to call scripts or do you only write your
scripts in a .vbs file? Tag: time synchronizer Tag: 182683
scripting gethostbyname
Here's a 3 line perl script that prints the IP address of a named host:
use Socket;
$packed = gethostbyname("$ARGV[0]") or die "unknown host: $ARGV[0]\n";
print inet_ntoa($packed);
Use like so (host name can be found via DNS or in local hosts file)
WINSERVER:rsr>perl gethostbyname.pl winserver
192.168.0.4
WINSERVER:rsr>perl gethostbyname.pl msnews.microsoft.com
207.46.246.16
How does one do that with windows scripting?
Thanks very much. Tag: time synchronizer Tag: 182682
Registry for MSN Messenger
Hi All,
Do anybody have an idea of " How to Autosave Conversations of MSN
messenger" through login script with the help of registry keys or some
thing like that.
OS -- win 98/2k Tag: time synchronizer Tag: 182681
running wmi query fails on certain computers.
Hi guys,
I wonder, you see the two queries below. The one that queries both
application and system logs (the one on the bottom) does not work on
certain computers - Windows 2000 Advanced Server - Windows 2000
domain). The same query works on other apparently similar computers.
If I run the query (the one on the top) that only queries the
application log it works ok.
The problem is that it does not produce any errors, it simply doesn't
fire any events.
The queries are always ran using domain admin credentials.
I would appreciate some help on this !
Thanks and Regards.
'OK
strWQL = "SELECT * FROM __InstanceCreationEvent WITHIN 15 WHERE
TargetInstance ISA 'Win32_NTLogEvent'" & _
"AND TargetInstance.Type = 'Error' AND TargetInstance.LogFile =
'Application'"
'NOT OK
strWQL = "SELECT * FROM __InstanceCreationEvent WITHIN 15 WHERE
TargetInstance ISA 'Win32_NTLogEvent'" & _
"AND TargetInstance.Type = 'Error' AND TargetInstance.LogFile =
'Application' OR targetinstance.logfile='system'"
Set objEventSource = objWMIService.ExecNotificationQuery(strWQL) Tag: time synchronizer Tag: 182679
Sessions not working correctly on ASP page
I have an ASP login section on my site that is experiencing some problems.
Go to the following page and create a fake account (this is a test
environment, so don't worry):
http://seminarystreet.com/dev_testing/registration/default.asp
Upon completion, you will be redirected to the login page, the new login
credentials are automatically inserted into the username and password
fields.
Click the Login button. Once logged in, click the logout button and you will
get a an error from my logout script, it completely refuses to log the
visitor out. I have SQL insert statement used for auditing that is expecting
the account_id to be passed, but it isn't there for some reason. Regardless,
with or without that statement, the logout fails.
Close out of the browser and go directly to the login page again, log in
using the same credentials and try logging out. It works correctly.
Now if you create a new account, close out of your browser and start a new
session and login, it works fine too. I'm at a loss of words on this one, so
any suggestions would really be appreciated. I've included links to the
associated pages below so that you can view the code:
Registration page:
http://seminarystreet.com/dev_testing/temp_code/registration/default.txt
Login page:
http://seminarystreet.com/dev_testing/temp_code/login/default.txt
Includes:
http://seminarystreet.com/dev_testing/temp_code/includes/global.txt
http://seminarystreet.com/dev_testing/temp_code/includes/sec-public.txt
http://seminarystreet.com/dev_testing/temp_code/includes/sec-private.txt
Like I said, any suggestions would be greatly appreciated.
Thanks,
Curt Tag: time synchronizer Tag: 182677
Re: how can i check what programs are installed on a remote computer on my
Sorry, I hit Send to fast... then I realized this in in vbscript group...
"Armin Freiberg" <A.Freiberg@cenit.de> schrieb im Newsbeitrag news:...
> Hi Lynn,
>
> try PSEXEC \\computer -c PSINFO.EXE
>
> Both programs are from www.sysinternals.com
... Tag: time synchronizer Tag: 182675
Getting data from DDE topic using VBScript
Hi,
I have a data source that exposes arrays of numbers using DDE
topics/items.
Is there a vbscript way to access these topics and items?
I could create an Excel spreadsheet and read it out of there, but that
seems an additional complication.
How can I get my data directly in vbscript?
TIA,
Vorpal Tag: time synchronizer Tag: 182670
WMI Network stats - incorrect object specification
I'm trying to write a custom vbscript to extract Network transfer rates
from a couple of servers using WMI.
I found a script that enumerates the data, but I can't figure out how
to specify the interface I want. I looked at Microsoft's site for
methods and properties, and while it shows a number of properties, it
isn't clear what the name of the parent property is.
The problem lines are:
wscript.echo TCPConfig.TotalBytesPerSecond(1)
wscript.echo TCPConfig.Properties.Name(1)
I know they're wrong - I'm guessing at the parent property names. I've
also tried:
wscript.echo TCPConfig.Item(1) (defaults sometimes work here)
wscript.echo TCPConfig.Name(1) (defaults sometimes work here)
wscript.echo TCPConfig.Properties.Name(1)
wscript.echo TCPConfig.Properties_.Name(1)
here is the script and the output:
strComputer = "."
Set TCPConfig =
GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_PerfRawData_Tcpip_NetworkInterface")
'wscript.echo TCPConfig.TotalBytesPerSecond(1)
'wscript.echo TCPConfig.Properties.Name(2)
For Each Connection In TCPConfig
wscript.echo "---- " & Connection.Name & " ---- "
For each Prop in Connection.Properties_
If (Not IsNull(Prop.Value) ) Then
wscript.echo Prop.Name & " " & Prop.Value
End If
on error resume next
Next
Next
---- 3Com 3C920 Integrated Fast Ethernet Controller [3C905C-TX
Compatible] - Packet Scheduler Miniport ----
BytesReceivedPersec -17429
BytesSentPersec 108180
BytesTotalPersec 36421
CurrentBandwidth 100000000
Frequency_Object 0
Frequency_PerfTime 357
Frequency_Sys100NS 10000000
Name 3Com 3C920 Integrated Fast Ethernet Controller [3C905C-TX
Compatible] - Packet Scheduler Miniport
OutputQueueLength 0
PacketsOutboundDiscarded 0
PacketsOutboundErrors 0
PacketsPersec 135
PacketsReceivedDiscarded 0
PacketsReceivedErrors 0
PacketsReceivedNonUnicastPersec 27
PacketsReceivedPersec 804
PacketsReceivedUnicastPersec 5159
PacketsReceivedUnknown 1706
PacketsSentNonUnicastPersec 86
PacketsSentPersec 5033
PacketsSentUnicastPersec 5025
Timestamp_Object 0
Timestamp_PerfTime 43181640
Timestamp_Sys100NS 1270805648484
---- MS TCP Loopback interface ----
BytesReceivedPersec 51
BytesSentPersec 510
BytesTotalPersec 1021
CurrentBandwidth 10000000
Frequency_Object 0
Frequency_PerfTime 355
Frequency_Sys100NS 1000
Name MS TCP Loopback interface
OutputQueueLength 0
PacketsOutboundDiscarded 0
PacketsOutboundErrors 0
PacketsPersec 10
PacketsReceivedDiscarded 0
PacketsReceivedErrors 0
PacketsReceivedNonUnicastPersec 0
PacketsReceivedPersec 51
PacketsReceivedUnicastPersec 51
PacketsReceivedUnknown 0
PacketsSentNonUnicastPersec 0
PacketsSentPersec 51665
PacketsSentUnicastPersec 51
Timestamp_Object 0
Timestamp_PerfTime 43164334
Timestamp_Sys100NS 1277508748484 Tag: time synchronizer Tag: 182669
function to get names from text file
Hi,
i have serveral scripts with need to get names from a text file.
does anybody have a function to get names from a text file?
so that i do not have to include the same code in every script that i
write?
thanks Tag: time synchronizer Tag: 182665
Back Entry Registry
Is there a way to backup the entry registry and just one hive?
Currently I'm using this this script:
sBackupFile = "C:\RegistryBackup.reg"
sRegPath = "HKEY_CURRENT_USER"
Set oShell = CreateObject("WScript.Shell")
oShell.Run "%comspec% /c reg.exe QUERY " _
& Chr(34) & sRegPath & Chr(34) _
& " /S >" & sBackupFile, 0, True Tag: time synchronizer Tag: 182664
Progress Bar Indicator with transfer rates Help Needed!!!!!!!!
Hi All
I need help with your .vbs expertise!!!!!
I've been trying to find a really good vb backup script with changeable
options, I've been searching for weeks and weeks and nothing has come
up. So I decided to have ago and fiddle with some vbscripting for
myself, I managed to copy some different scripts from here and there
and edit some bits and pieces of it, and finally I have something close
to what I needed, everything seems to works fine.
I've come to the point ware its way over my head, I wood like to add
a "Progress Bar Indicator with transfer rates and times" I've got a
working bar (See Part B) but I don't know how to add it into my script
correctly (Dynamically) so it shows the progress, rates and time
remaining of the files being transferred (the files and sizes can be
different all the time) I've tried loads of different things with the
two script but with no avail.
It would be much appreciated if you could help!!!!
Here's the code
'----------------------------------------
'=============================================================================
' B A C K U P
'
'
' This vbs script is designed to take scheduled backups from disk to
disk and disk to server .
'
' Set your preferred options and paths below.
'
' Add this script to your scheduler.
'
'=============================================================================
OPTION EXPLICIT
dim objNetwork
dim strDriveLetter, strRemotePath, strUser, strPassword, strProfile,
strname
dim objFSO
dim FoldersToBackup
dim BackupFolder, LastBackupLog, BackupSummaryLog
'-----------------------------------------------------------------------------
' Set your preferred options Here
'-----------------------------------------------------------------------------
On Error Resume Next
strDriveLetter = "W:"
strRemotePath = "\\servername\user"
strUser = "trevor"
strPassword = "trev0r"
strProfile = "True"
strName = "Backup"
Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, _
strProfile, strUser, strPassword
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter).Self.Name = strName
const AUTO_SECONDS = 45 ' Show the startup dialog for this number of
seconds
' 0 = Don't show it at all - beware of innocents!
' -1 = Wait for a click, forever if necessary
const BACKUP_ALWAYS = false ' false = new and changed files true =
all files
const ZAP_BEFORE = false ' true = delete all existing contents of the
folder
const QUIT_ON_ERROR = false ' true = abandon job on any error
otherwise ignore and continue
const SHOWRESULTS_EOJ = true ' false = don't bother
FoldersToBackup = array( _
"C:\public", _
"C:\Documents and Settings\trevor\learningvbs" _
)
'
' The destination may either be specified as a single string, in which
case the backup
' will always be made to the same place, or it may be specified as an
array of SEVEN
' destinations, in which case the backup will go to the appropriate
place depending on
' which day of the week it is at BOJ. The days are:- Sun, Mon, ... Sat
BackupFolder = array( _
"W:\", _
"W:\", _
"W:\", _
"W:\", _
"W:\", _
"W:\", _
"W:\" _
)
LastBackupLog = "c:\LastBackup.txt"
BackupSummaryLog = "c:\BackupSummary.txt"
'-----------------------------------------------------------------------------
' Don't fiddle below here
'-----------------------------------------------------------------------------
const PROGRAMID = "BACKUP "
const PROGRAMVERSION = " v1.5"
dim fs, AutoRun
dim FilesCopied, BytesCopied, CopyErrors
dim StartTime, StopTime
dim OutputSPO
dim BackupDetail, BackupSummary
dim WeekdayNumber
sub CheckRuntimeOptions
dim x, i, NL, wsh
NL = vbCr & vblf
x = "YOUR PC WILL NOW BACKUP "
if BACKUP_ALWAYS then
x = x & "ALL FILES "
else
x = x & "NEW AND CHANGED FILES "
end if
x = x & NL & NL
x = x & "To " & ucase(CurrentBackupFolder()) & NL & NL & NL
x = x & NL & "From" & NL & NL
for i = lbound(FoldersToBackup) to ubound(FoldersToBackup)
x = x & ucase(FoldersToBackup(i)) & NL
next
if not AutoRun then
if (AUTO_SECONDS > 0) then
set wsh = CreateObject("wscript.shell")
if wsh.popup(x,AUTO_SECONDS,PROGRAMID & PROGRAMVERSION,1) = 2 then
wscript.quit
end if
set wsh = nothing
elseif msgbox (x,1,PROGRAMID & PROGRAMVERSION) = 2 then
wscript.quit
end if
end if
StartLogging
WriteLog x,true
end sub
sub StartLogging
if len(LastBackupLog) > 0 then
set BackupDetail = fs.CreateTextfile(LastBackupLog)
end if
if len(BackupSummaryLog) > 0 then
if fs.FileExists(BackupSummaryLog) then
set BackupSummary = fs.OpenTextfile(BackupSummaryLog,8) '
forAppending
else
set BackupSummary = fs.CreateTextfile(BackupSummaryLog)
end if
end if
WriteLog PROGRAMID & PROGRAMVERSION,true
FilesCopied = 0
BytesCopied = 0
end sub
sub WriteLog(msg,SummaryInfo)
if OutputSPO then
wscript.echo msg
end if
if isObject(BackupDetail) then
BackupDetail.writeLine "" & Now & " = " & msg
end if
if SummaryInfo and isObject(BackupSummary) then
BackupSummary.writeLine "" & Now & " = " & msg
end if
end sub
sub ZapFolder(fldrname)
dim sf, fldr, fl
WriteLog "Zapping contents of " & fldrname,false
set fldr = fs.GetFolder(fldrname)
set sf = fldr.SubFolders
for each fl in sf
ZapFolder fs.BuildPath(fldrname,fl.name)
fl.delete
next
set sf = fldr.Files
for each fl in sf
WriteLog "Zapping file " & fl.path, false
fl.delete
next
end sub
function CurrentBackupFolder()
if isArray(BackupFolder) then
CurrentBackupFolder = BackupFolder(WeekdayNumber)
else
CurrentBackupFolder = BackupFolder
end if
end function
function BackupSubFolderName(fldrname)
'
' Take the original foldername which may contain either drive letters
or UNCs
' and create relevant subfolder within BackupFolder
'
dim bfldrname
bfldrname = replace(fldrname,":","\")
bfldrname = replace(bfldrname,"\\","\")
BackupSubFolderName = bfldrname
end function
function MakeBackupFolder(fldrname)
dim bfldrname, pbfldrname, fbfldrname
if len(fldrname) = 0 then
MakeBackupFolder = true
exit function
end if
bfldrname = BackupSubFolderName(fldrname)
fbfldrname = fs.BuildPath(CurrentBackupFolder(),bfldrname)
if not fs.FolderExists(fbfldrname) then
pbfldrname = fs.GetParentFolderName(bfldrname)
if not MakeBackupFolder(pbfldrname) then
exit function
end if
fs.CreateFolder(fbfldrname)
end if
MakeBackupFolder = true
end function
function DoThisFile(fl,srcfolder,bpath)
dim bf, res
ON ERROR RESUME NEXT
bpath =
fs.BuildPath(CurrentBackupFolder(),fs.BuildPath(BackupSubFolderName(srcfolder),fl.name))
if BACKUP_ALWAYS then
res = true
elseif not fs.FileExists(bpath) then
res = true
else
set bf = fs.GetFile(bpath)
res = (bf.DateLastModified <> fl.DateLastModified)
set bf = nothing
end if
DoThisFile = res
end function
sub DoBackup(srcfolder)
dim sf, fldr, fl, bpath
ON ERROR RESUME NEXT
if not MakeBackupFolder(srcfolder) then
exit sub
end if
set fldr = fs.GetFolder(srcfolder)
set sf = fldr.SubFolders
for each fl in sf
DoBackup fs.BuildPath(srcfolder,fl.name)
next
set sf = fldr.Files
for each fl in sf
if DoThisFile(fl,srcfolder,bpath) then
WriteLog "Backing up " & fl.path ,false
fl.copy bpath
if err.number <> 0 then
WriteLog "** ERROR ** " & err.number & "; " & err.description,false
CopyErrors = CopyErrors + 1
else
FilesCopied = FilesCopied + 1
BytesCopied = BytesCopied + fl.size
end if
end if
next
end sub
sub ShowResults
dim x
x = "Files Copied = " & vbTab & FilesCopied & vbCr & vbLf
x = x & "Bytes Copied = " & vbTab & BytesCopied & vbCr & vbLf
x = x & "Copying Errors = " & vbTab & CopyErrors & vbCr & vbLf
x = x & "If Coping Errors = 1 or more contact your IT Support" & vbCr
& vbLf
x = x
& "----------------------------------------------------------------"
WriteLog x,true
if SHOWRESULTS_EOJ then
msgbox x,0,PROGRAMID
end if
end sub
function ConsoleStreamsOK()
'
' This determines whether or not console mode streaming I/O is
available
' so that detailed progress can be monitored easily but the system
won't
' block up with message boxes if run windowed.
'
if not isObject(WScript.StdOut) then
exit function
end if
if isNull(WScript.StdOut) then
exit function
end if
if instr(1,WScript.Fullname,"cscript",1) then ' vbTextCompare
ConsoleStreamsOK = true
end if
end function
'
' Mainline starts here ...
'
dim i
AutoRun = (AUTO_SECONDS = 0)
on error resume next
OutputSPO = ConsoleStreamsOK()
if (wscript.arguments.count >= 1) then
if(ucase(wscript.arguments(0)) = "AUTO") then
AutoRun = TRUE
end if
end if
set fs = CreateObject("Scripting.FileSystemObject")
WeekdayNumber = Weekday(Now) - 1
CheckRuntimeOptions
if not fs.FolderExists(CurrentBackupFolder()) then
WriteLog "Creating folder " & CurrentBackupFolder(),false
fs.CreateFolder(CurrentBackupFolder())
end if
if ZAP_BEFORE then
ZapFolder CurrentBackupFolder()
end if
for i = lbound(FoldersToBackup) to ubound(FoldersToBackup)
if not MakeBackupFolder(FoldersToBackup(i)) then
if QUIT_ON_ERROR then
wscript.quit
end if
end if
DoBackup FoldersToBackup(i)
next
ShowResults
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\LastBackup.txt" , "W:\"
objFSO.CopyFile "C:\BackupSummary.txt" , "W:\"
Set objFSO = Nothing
'------------------------------------------------------------------
Here's the code for the progress bar
'------------------------------------------------------------------
'WScript.Timeout = 7
'WScript.Sleep 300
dim bar, b
set bar = createobject("JSProgBr.Bar")
bar.Title = "Progress Bar"
bar.Caption = "Testing progress bar. . . "
bar.Show True, True
For b = 0 to 29
bar.Advance
wscript.sleep 500
if b = 15 then
bar.Caption = "Halfway. . . "
end if
if b = 25 then
bar.Caption = "Almost done . . ."
end if
next
bar.hide
set bar = nothing Tag: time synchronizer Tag: 182662
Browser Session
This is a multi-part message in MIME format.
------=_NextPart_000_0015_01C5DBF5.C1B54500
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi All,
According to a book, the cookie without expires lasts the browser =
session. I think a browser session ends if you close all the browser =
windows. I setup a cookie without expires in IE using JavaScript and =
closed it. When I open IE agian, the cookie is still there. Why?
Thank you.
------=_NextPart_000_0015_01C5DBF5.C1B54500
Content-Type: text/html;
charset="iso-8859-1"
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-1">
<META content=3D"MSHTML 6.00.2900.2769" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi All,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>According to a book, the cookie without =
expires=20
lasts the </FONT><FONT face=3DArial size=3D2>browser session. I =
think a=20
browser session ends if you close all the browser windows. I setup =
a=20
cookie without expires in IE using JavaScript and closed it. When =
I open=20
IE agian, the cookie is still there. Why?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thank you.</FONT></DIV></BODY></HTML>
------=_NextPart_000_0015_01C5DBF5.C1B54500-- Tag: time synchronizer Tag: 182641
Script to find NIC binding order.
I am writing a script to verify that our servers are configured according to
a standard build. I have one check that I can't figure out.
Does anyone know how to query the NIC binding order that is being used?
Need the same info that is provided by:
Right Click "My Network Places" > Properties
Click "Advanced" Menu item.
Click "Advanced Settings"
information under "Connections" is the information I need.
Thanks in advance for your help!
- JMC Tag: time synchronizer Tag: 182635
Check if filename and variants of filename exist
I am trying to write a script that will perform an action on a file if
it exists. Can a string value be used with the FileExists method (ie
If objFSO.FileExists("strFielname"))?
I am asking the script user for input of path\filename and I need to
base three variables on the input. If i can use the variable with the
FileExists method, then how can I say "strFilename2 = strFilename plus
a character" and strFilename3 = strFilename plus a character?
Basically i have a file c:\blahblah\xyz.abc, which is what the user
will input, and i need to perform the action on it, then go back and
perform the same action on xyze.abc and xyzf.abc which are in the same
folder. One minor wrinkle is that there are files xyz000.abc, etc that
can't be touched, so I can't use a wild card. How can I do this?
Thanks! Tag: time synchronizer Tag: 182629
IIS Provider GetObject hangs in IE
Following is the line that hangs:
Set IISclass = GetObject("IIS://" & strServer & "/w3svc")
It works fine from a dos window but hangs when executed from a web page. I know it's not the getobject as the WinNT getobject works fine.
This happens only on a particular xp sp2 workstation (my boss') works fine on others. I uninstalled and re-installed IIS common files and IE on that workstation, compared ie security configurations and firewall configuration with working machines, but no go.
Any help would be appreciated.
Thanks.
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources... Tag: time synchronizer Tag: 182628
i need a script to synchronize my pc clock, with a server in internet