FTP file that is 1 day old?
I was able to write a FTP script to download logfiles from a server and
it works well. The problem is it grabs all the files.
I only want to retrieve the logfile that is 1 day old. Everyday.
Basically grabbing the file from the night before.
I wish there was a "get yesterdays dated file" variable Tag: Delete dial up networking Tag: 184261
password changer
Hi, I'm having problems writing a password change script.
I want to give my users the ability to change their AD domain password via
a local script.
I also want the user to just put in their sAMAccountName and NOT their dn in
the input box for user name.
I think i have to use the WinNt provider for that and not LDAP.
Finally, i guess i have to use IE to mask the password as they are typing it.
Thanks.
P.S- is there anyway to have the script send an email via CDO if it fails
and an clear error message as to why or is this not feasible on many local
machines?
Thanks again!! Tag: Delete dial up networking Tag: 184256
Help with opentext function in vbscript
I am a novice at coding in vbscript and I have a problem that has been
bothering me for about a week. I am trying to write a script that will
open a text file and import it into excel (snippet of the code is
below). When I try to use the opentext function as shown below, I
received an error stating that "opentext method of wrokbooks class
failed" can anyone please explain to me why this is happening adn how
to correct it. I am sure the file exist in the same directory as the
script.
Dim excelprog
Set excelprog = WScript.CreateObject("Excel.Application")
excelprog.Application.Visible = True
excelprog.Workbooks.OpenText ("c:\test.txt", 437, 1, xlDelimited, 1,
False, False, True, False, False, False, , , comma, comma) Tag: Delete dial up networking Tag: 184253
Subject Field Propogating Unwanted Characters Instead of Spaces
I have job postings that pull from a db on my website and when you click the
email link for a particular job it populates the subject field with it's job
code.
For some reason some people are getting some jargen in the subject field
like this...
Subject: JobÃ? Code:Ã? 992
When it should look like this...
Subject: Job Code: 992
I guess some browsers or MS Outlook reads the code differently than other.
Is there a way to correct this so it works for all?
[code]
Response.Write("<B>Apply:</B> Send an e-mail to <A HREF=mailto:" &
rsUserSpec("EMailAddress") & "?subject=Job Code: " &
rsNewsItems("JobCode") & ">" & rsUserSpec("FirstName") & " " &
rsUserSpec("LastName") & "</A>" & "<BR>")
Response.Write("<img src=""../shim.gif"" width=""10"" height=""10"">
</td>")
[code]
Thanks,
Lauren Tag: Delete dial up networking Tag: 184250
Create computer account in specified AD OUs
Were in the process of rolling out over 1000 workstations that need to
be placed within different OU's.
I \'d like to know if there are any scripts that can read a text file a
pre-create the workstation accounts in the given OU's then when we
actually join the workstations to the domain they will fall into the
correct OU.....
Thanks in advnace........ Tag: Delete dial up networking Tag: 184246
Create computer account in specified AD OUs
Were in the process of rolling out over 1000 workstations that need to
be placed within different OU's.
I \'d like to know if there are any scripts that can read a text file a
pre-create the workstation accounts in the given OU's then when we
actually join the workstations to the domain they will fall into the
correct OU.....
Thanks in advnace........ Tag: Delete dial up networking Tag: 184245
Querying the current user profile size
I need to get the value of the current user's profile size, then insert
that value into the registry.
I have found a similar script which gets the size of the current user's
My Documents folder (see below) and inserts into the registry, but I
cannot find anything similar for the current user profile size.
Many thanks
Option Explicit
Const REG_SZ = 1
Const REG_EXPAND_SZ = 2
Const REG_BINARY = 3
Const REG_DWORD = 4
Const REG_MULTI_SZ = 7
Const CSIDL_PERSONAL = &H5& '// My Documents
Dim objWSH, blnKey, objFSO, objShell, objFolder, lSize, sRegPath, x
sRegPath = "HKCU\MyDocuments_Size"
'// Open, use, destroy ...
Set objShell = CreateObject("Shell.Application")
objFolder = objShell.Namespace(CSIDL_PERSONAL).self.path
Set objShell = Nothing
'// Get the size and store it in a local var
Set objFSO = CreateObject("Scripting.FileSystemObject")
lSize = objFSO.GetFolder(objFolder).Size: Set objFolder = Nothing: Set
objFSO = Nothing
Set objWSH = WScript.CreateObject("WScript.Shell")
'// Code to create the key (sRegPath must end in a backslash for this)
objWSH.RegWrite sRegPath, 1, "REG_SZ"
'// Code to add the value
objWSH.RegWrite sRegPath, lSize, "REG_SZ"
Set objWSH = Nothing Tag: Delete dial up networking Tag: 184243
CreateObject("WScript.Shell")
I'm using the following code to verify the status of computers. The problem
is that each time a command prompt is launched the focus is changed... Is
there a way to make the process invisible to the user?
**************
Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("ping " & strComputer & " -n 1")
Set objStdOut = objWshScriptExec.StdOut
For j = 1 To 3
strLine = objStdOut.ReadLine
Next
strLine = objStdOut.ReadLine
**************
Thank you for the help,
Daniel Tag: Delete dial up networking Tag: 184242
Query Active Directory for Computer Description
Is it possible through an ADSI script to query Active Directory for a
computers description? IE: Take a text file with a list of computers â?? run a
script â?? a new text file is created with the list of computers each on
followed by the description that is in AD? If so can anyone point me to some
resources? This would be a great help to my department as our machines are
all labeled in AD with the users name and we continually have to manually
sort through thousands of machines.
Thanks Tag: Delete dial up networking Tag: 184238
FTP script to download, then delete a file who's name changes based on time.
Relatively new (actually brand new) to vbscripting. I've searched the
groups for what I'm looking for but I just cant find it. Basically, I
need a script that can automatically run on windows200serverA FTP into
windows2000serverB and download log files. The log files are created
in a time format like "yyyymmdd.dat". Since I only want complete logs
I would need the script to be able to FTP into the server today and
grab yesterdays file and so on and so on. So if today were Dec 10,
2005 the file that i would need to download would be 20051209.dat (that
would be the file from Dec,9,2005). I wouldnt want the Dec10 file
until Dec11.
I really need to learn vbscript and figure this all out on my own but
time is not on my side on this one. Can anyone assist? Tag: Delete dial up networking Tag: 184236
How to create script to read multiple files, modify and write to new files
All,
I'm hoping someone can help. I'm working on a project where I have
about 30 csv files that I continuously have to edit, strip off the
header row, save and move to another folder where I upload them to an
FTP server.
I'd like to be able to create a vbscript that would automate the
process by reading each of the csv files in a folder skipping line 1
and writing them back to a file in a new folder.
I've seen bits and pieces of what I need in other posts but I can't
seem to get the whole process working..
Thanks in advance!
......Chris
cmoorhead@mindspring.com Tag: Delete dial up networking Tag: 184235
Parsing Saved Event logs Files
I have a script that I'd like to modify. I first examine the event logs on a
server and report on any errors and audit failures to an HTML file. Then I
back up the logs and clear the logs. I would like to first backup the logs
then parse the saved logs to the script that creates the HTML file. My
question is how can I parse the backed-up event log file so as to capture the
needed errots for creating the HTML file. Shown below is the section of the
code that I use to create the HTML file from the Event Logs. Can some tell
me how I might modify it?
Thanks,
Frank
' +++++++++++++++++ Begin of VBScript Code +++++++++++++++++ '
Const ieCRLF = "<br>"
Const ieSPACE = " "
Const ForAppending = 8
sServer = "."
sFileName = "C:\Temp\EvtLog-Test.html"
Set oF_Sys = CreateObject( "Scripting.FileSystemObject" )
Set oWMIService = GetObject( "winmgmts:" & "{impersonationLevel=" & _
"impersonate}!\\" & sServer & "\root\cimv2" )
Set colEvents = oWMIService.ExecQuery( "Select * from Win32_NTLogEvent " & _
"Where Type = 'audit failure' or Type = 'error'" )
Set oAdd2File = oF_Sys.OpenTextFile( sFileName, ForAppending, TRUE )
oAdd2File.WriteLine "<html><head><title>Event Logs Errors Report, " & Now()
& _
" </title></head>" & vbCRLF & "<body bgcolor='white'>" & ieCRLF & vbCRLF & _
String( 108, "=" ) & ieCRLF & vbCRLF & "</big></b> <table width='100%'>" & _
vbCRLF & "<tr><td width='10%'> <b>LogFile</b></td>" & vbCRLF & _
"<td width='18%'><b> Date" & vbCRLF & " Time</b></td>" & _
vbCRLF & "<td width='10%'><b>EventCode</b></td>" & vbCRLF & _
"<td width='12%'><b>Source</b></td>" & vbCRLF & "<td width='50%'><b>" & _
"Message</b></td>" & vbCRLF & "</tr>"
If NOT IsEmpty( colEvents ) Then
For Each oService In colEvents
oAdd2File.WriteLine ("<tr><td width='10%'>" & oService.LogFile & _
"</td><td width='18%'>" & Left( oService.TimeGenerated, 14 ) & _
"</td><td width='10%'>" & oService.EventCode & "</td>" & _
"<td width='12%'>" & oService.SourceName & "</td>" & _
"<td width='50%'>" & oService.Message & "</td></tr><tr></tr>")
Next
'Else
' wscript.echo "Nada"
End If
oAdd2File.WriteLine ("<tr></tr></table>" & ieCRLF & "<big><i><b>End of
report " & _
"for server: " & sServer & ieCRLF & "</b></i></big>")
oAdd2File.Close
Set oAdd2File = Nothing
Set oF_Sys = Nothing
Set colEvents = Nothing
Set oWMIService = Nothing
' ++++++++++++++ End of VBScript Code ++++++++++++++ ' Tag: Delete dial up networking Tag: 184233
Multiple If's
Is there a way to convert the following into a Select Case statement?
If ((x = 1) And (y = 1)) Then
z = 123
ElseIf ((x = 1) And (y = 2)) Then
z = 456
ElseIf ((x = 2) And (y = 1)) Then
z = 789
End If Tag: Delete dial up networking Tag: 184232
Printer usage
Good morning,
I have the following script that tracks a specific printer's usage.
Originally it used a wscript.echo to notify me but I am trying to make it log
the usege to a file instead. The problem is that using different
permutations I have been unable to get the script to produce a proper log.
Either it doesn't log anything or else it logs the same print job a multitude
of times. Can someone help me fix/debug my script.
*************
strComputer = "."
Const FOR_APPENDING = 8
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objFSO = CreateObject("Scripting.FileSystemObject")
LogFileName = "ptclaire7_prn2c.Log"
Set objFile = objFSO.OpenTextFile(LogFileName,FOR_APPENDING,True)
Set colPrintJobs = objWMIService. _
ExecNotificationQuery("Select * From __InstanceCreationEvent " & "Within
5 Where TargetInstance ISA 'Win32_PrintJob'")
Do While True
Set objPrintJob = colPrintJobs.NextEvent
If InStr(objPrintJob.TargetInstance.Name, "ptclaire7_prn2c") Then
addtxt = objPrintJob.TargetInstance.Owner & " - " &
objPrintJob.TargetInstance.TotalPages & " - " &
objPrintJob.TargetInstance.PagesPrinted & " - " &
objPrintJob.TargetInstance.Document
End If
ObjFile.WriteLine addtxt
Loop
*************
Thank you,
Daniel Tag: Delete dial up networking Tag: 184229
Help! WMI and Windows Media Player
Hi
I'm putting together a script to gather info on certain software packages
such as version number etc... installed on multiple desktops.
My problem is trying to extract the version information from Windows Media
Player.
I can't get any results from using the Win32_Product class or from querying
the uninstall kep HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
I could query the executable directly but would prefer not to as some of the
versions are very old so some will be Mplayer.exe, Mplayer2.exe, WMPlayer.exe
etc...
Does anyone know of a class I can use to query info about media player?
Thanks
Steve Tag: Delete dial up networking Tag: 184226
VBS script to backup Cisco configs
Hello,
I need some assistance on a script I am writing. Its purpose is to
backup running-config files from Cisco switches via telnet and TFTP.
I need to address the following problems...
1. All the DOS windows open at once, I would like them to open in
order.
2. All the uploaded file names are identical. Hence the previous ones
are overwritten
3. I would like the script to read from a text file of IPs
Any pointers in the right direction would be appreciated.
Many thanks.
@echo off
echo set sh=WScript.CreateObject("WScript.Shell")>telnet.vbs
echo WScript.Sleep 500>>telnet.vbs
echo sh.SendKeys "password">>telnet.vbs
echo sh.SendKeys "~">>telnet.vbs
echo sh.SendKeys "en">>telnet.vbs
echo sh.SendKeys "~">>telnet.vbs
echo sh.SendKeys "password">>telnet.vbs
echo sh.SendKeys "~">>telnet.vbs
echo sh.SendKeys "copy running-config tftp://192.168.0.1">>telnet.vbs
echo sh.SendKeys "~">>telnet.vbs
echo sh.SendKeys "~">>telnet.vbs
echo sh.SendKeys "~">>telnet.vbs
echo sh.SendKeys "exit">>telnet.vbs
echo sh.SendKeys "~">>telnet.vbs
start /realtime telnet.exe 192.168.0.10 (first device)
cscript.exe //nologo telnet.vbs
start /realtime telnet.exe 192.168.0.11 (second device)
cscript.exe //nologo telnet.vbs
del telnet.vbs Tag: Delete dial up networking Tag: 184225
Vbscripting calling Regedit /s problem
Folks,
Need some assistance, I'm writing a login script to install a piece of
software on PCs when people login. The softrware requires me to add registry
change to each machine so I have call the "regedit /s" command using the
vbscript. The problem is my script only creates the folders in the registry
but does not add any registry keys. If I run the command directly from
command prompt it works. Below is an example of the vbscript and registry
file, if anyone can help me out on this problem, much appreaciated.
vbscript
Set wshShell = CreateObject("WScript.Shell")
wshShell.Run("RegEdit /s" & "c:\pcmon.reg")
registry file
[HKEY_LOCAL_MACHINE\SOFTWARE\PCwatch\pcmon]
"LogFileDir"="\\\\MGMT-WATCH\\public$\\logfiles"
"ProdVer"="Focus"
"TCPIPServer"="MGMT-WATCH"
"UDPServer"="MGMT-WATCH"
"ConfigServer"="MGMT-WATCH"
thanks,
Liam Mac Tag: Delete dial up networking Tag: 184222
Auto-logon to a telnet server
Hi all,
I am trying to get a batch / vbs script to auto-logon to a telnet
server. Basically the batch file below creates and runs a vbs script on
the fly. I actually got the idea from another Google posting. The
problem is the SendKeys are not being sent to the telnet window. I have
changed the target to notepad and I am left with an empty screen. Can
any one suggest a way of getting this working?
Many thanks for your time.
Paul
@echo off
echo set sh=WScript.CreateObject("WScript.Shell")>telnet.vbs
echo WScript.Sleep 500>>telnet.vbs
echo sh.SendKeys "my_password">>telnet.vbs
start /realtime telnet 192.168.0.1
C:\WINNT\system32\cscript.exe //nologo telnet.vbs Tag: Delete dial up networking Tag: 184221
Impersonate script
hola, tengo un script que introduce el usuario que hace logon en el
grupo administradores local. pero necesito que dentro del script se le
pasen las credenciales de admin de dominio para que tenga permisos para
hacerlo. =BFC=F3mo se hace?
Muchas gracias
-----
I've got a script that add the domain user (the user that makes the
logon) into the administrators local group. But I need that the script
gives domain administrator credentials to do this thing. Any ideas?
Thanx. Tag: Delete dial up networking Tag: 184219
Question on Regular Expression
Hello all,
I have to check the spelling of a given string(predefined but user can
change) and i should also check for the opening and closing tags of the
string. i thought i could use Regular expression. but i am stuck up in the
middle
Ex: (contents of the predefned text)
<Effect of Problem> </Effect of Problem>
<Solution> </Solution>
<Reason for this problem> </Reason for this problem>
<How to Fix> </How to Fix>
The above text are predefined in a text box (in vb 6.0). The user might or
might not change the text
But during Submit i have to check for the spelling of the text inside <> and
also have to check for the opening and closing of the tags and i should
ensure that above mentioned tags are present
First, is this possible to do with RegExp?
Can any one help me on this ?
Thanks in advance
Regards
Karthik K Tag: Delete dial up networking Tag: 184216
Compare two text files
How do I compare two text files with a list of computers in them? The
files were created using the (object.writeline %computername%, vbCrLf)
command. I have a vbscript that queries SMS each day for active
computer accounts. I don't care about any new accounts only the ones
that are missing from the text file the day before.Thanks in advance,
SMS_day1.txt
****************
Computer1
Computer2
Computer3
Computer4
SMS_day2.txt
******************
Computer2
Computer3
Computer5
Computer7
Computer8
I want to know which computers SMS deletes from it's database each
day. Tag: Delete dial up networking Tag: 184214
Nested quotations in WMI/VBScript/WQL Select
At url
http://www.microsoft.com/technet/scriptcenter/guide/sas_fil_lifi.mspx
there is a sample script (Listing 11.29 Monitoring File Creation). In
it, the author uses a literal to name the folder path he/she wants to
watch. I would like to supply this script with a command line argument
to be assigned to a variable and used in place of the literal. But I
am having a terribly hard time figuring out how to do that.
Any help would be appreciated.
Dennis Glover Tag: Delete dial up networking Tag: 184207
Import LMHOST
Hi,
Is there a way to create a vb script to import LMHOST file automatically?
Please advice, thanks!
-P Tag: Delete dial up networking Tag: 184206
vbs to logoff
Hello
I need to create a simple script that will run "shutdown -f -l -t00"
I want to schedule this script so that pcs will logoff at a specific time.
I know I can do this via a batch file but I would rather do this in a
script if possible.
Thanks in advance! Tag: Delete dial up networking Tag: 184204
Adjust COM+/DCOM Activation/Launch permissions via vbscript?
Is it possible to adjust DCOM Activation and Launch permissions via a
vbscript? I'm looking to do this for a couple DCOM applications (Volume
Shadow Copy, and a few Removable Storage apps).
Thanks,
Trevor Tag: Delete dial up networking Tag: 184203
Saved Event logs Reporting
I have a script that I'd like to modify. I first examine the event logs on a
server and report on any errors and audit failures to an HTML file. Then I
back up the logs and clear the logs. I would like to first backup the logs
then parse the saved logs to the script that creates the HTML file. My
question is how can I parse the backed-up event log file so as to capture the
needed errots for creating the HTML file. Shown below is the section of the
code that I use to create the HTML file from the Event Logs. Can some tell
me how I might modify it?
Thanks,
Frank
' +++++++++++++++++ Begin of VBScript Code +++++++++++++++++ '
Const ieCRLF = "<br>"
Const ieSPACE = " "
Const ForAppending = 8
sServer = "."
sFileName = "C:\Temp\EvtLog-Test.html"
Set oF_Sys = CreateObject( "Scripting.FileSystemObject" )
Set oWMIService = GetObject( "winmgmts:" & "{impersonationLevel=" & _
"impersonate}!\\" & sServer & "\root\cimv2" )
Set colEvents = oWMIService.ExecQuery( "Select * from Win32_NTLogEvent " & _
"Where Type = 'audit failure' or Type = 'error'" )
Set oAdd2File = oF_Sys.OpenTextFile( sFileName, ForAppending, TRUE )
oAdd2File.WriteLine "<html><head><title>Event Logs Errors Report, " & Now()
& _
" </title></head>" & vbCRLF & "<body bgcolor='white'>" & ieCRLF & vbCRLF & _
String( 108, "=" ) & ieCRLF & vbCRLF & "</big></b> <table width='100%'>" & _
vbCRLF & "<tr><td width='10%'> <b>LogFile</b></td>" & vbCRLF & _
"<td width='18%'><b> Date" & vbCRLF & " Time</b></td>" & _
vbCRLF & "<td width='10%'><b>EventCode</b></td>" & vbCRLF & _
"<td width='12%'><b>Source</b></td>" & vbCRLF & "<td width='50%'><b>" & _
"Message</b></td>" & vbCRLF & "</tr>"
If NOT IsEmpty( colEvents ) Then
For Each oService In colEvents
oAdd2File.WriteLine ("<tr><td width='10%'>" & oService.LogFile & _
"</td><td width='18%'>" & Left( oService.TimeGenerated, 14 ) & _
"</td><td width='10%'>" & oService.EventCode & "</td>" & _
"<td width='12%'>" & oService.SourceName & "</td>" & _
"<td width='50%'>" & oService.Message & "</td></tr><tr></tr>")
Next
'Else
' wscript.echo "Nada"
End If
oAdd2File.WriteLine ("<tr></tr></table>" & ieCRLF & "<big><i><b>End of
report " & _
"for server: " & sServer & ieCRLF & "</b></i></big>")
oAdd2File.Close
Set oAdd2File = Nothing
Set oF_Sys = Nothing
Set colEvents = Nothing
Set oWMIService = Nothing
' ++++++++++++++++++ End of VBScript Code ++++++++++++++++++ ' Tag: Delete dial up networking Tag: 184202
is there a way to set user enviroment from vbscript?
I tried the example from the script help
Dim WshShell, WshEnv
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshEnv = WshShell.Environment("USER") ' I replaced PROCESS with USER
hoping for better result
WshEnv("TestVar") = "Windows Script Host"
However when the script finishes, there is no TestVar around in the dos
prompt that executed the script..
I only need the set an environment variable just for the DOS prompt session. Tag: Delete dial up networking Tag: 184199
Userdata limits
Hello,
Iâ??m using userdata.save to save sum info.
I have found that there are size and number limits for the userdata storage
area.
What will happen if I will try to save and userdata storage area will be full.
Is there a way to ensure that my data will be saved.
Thanks
Rami Tag: Delete dial up networking Tag: 184196
Controllers
Using the code below, I am able to retrieve a SCSI Controller's name.
However, what I really need to retrieve is the SCSI Controller's
firmware version? Any suggestions?
strComputer = "."
set shell = createobject("wscript.shell")
set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
set colItems = objWMIService.ExecQuery("SELECT * FROM "_
& "Win32_SCSIController", "WQL", &h10 + &h20)
contCount = 1
For Each objItem In colItems
wscript.echo "Controller" & contCount& ": " & objItem.Name
contCount = contCount + 1
Next Tag: Delete dial up networking Tag: 184195
Redirects - 301 vs. 302
Our site uses response.redirect statements intensively to simplify our
internal links. We have recently purchased a Google Search appliance, which
requires us to use 301 redirects (using Response.Status and
Response.AddHeader instead) to work correctly.
I have tested this method, and it appears to work correctly. I understand
that some browsers may change bookmarks to the destination URL, which is fine
as well. I am just wondering if there are any other differences that I
should be aware of before making this change.
Feel free to point me to a more appropriate newsgroup if this is OT. Thanks! Tag: Delete dial up networking Tag: 184193
MS Cluster scripting question
I'm trying to pull all the Cluster Names in the domain using a
VBScript. I have seen this reference to the Cluster Automation Server
on MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mscs/mscs/clusapplication_clusternames.asp
It looks like I should be able to do this with something similar to
this (which of course doesn't work). I am running this on the Cluster
server:
~~~~~~
Set objCluster = CreateObject("MSCluster.ClusApplication")
set objClust2 = objCluster.ClusterNames("acme.local")
For Each objClust In objClust2
WScript.Echo objClust.Item
Next
I have this script that works to pull the active node from a group so I
think I'm on the right track:
Set objCluster = CreateObject("MSCluster.Cluster")
objCluster.Open("sql1t")
WScript.Echo objCluster.ResourceGroups.Item("Cluster
Group").OwnerNode.Name
Set objCluster = Nothing
TIA
Chris Bodnar Tag: Delete dial up networking Tag: 184192
scan log and send email
I have a spam blocker running on my exchange server (GFI MailEssentials). I
have it set to log any emails that were deleted by the keyword checking part
of it. I'd like to set up a script that runs once a day that will scan the
log file and send an email to the original recipient with a list of emails
that were deleted. Here's the layout of the log file: (also attached as a
text file)
"11/29/05 08:53:01","Anti-Spam Keyword
Checking","vxbhqfotnwl@hotmail.com","username1@domaina.com","Viagra Pro will
make you happy with life","Deleted","Found word(s) viagra in the subject"
"11/29/05 10:25:29","Anti-Spam Keyword
Checking","futzonscpqx@hotmail.com","username2@domaina.com","Soft Cialis -
ideal remedy for impotence.","Deleted","Found word(s) Impotence CIALIS in
the subject"
"11/29/05 16:11:57","Anti-Spam Keyword
Checking","dqndwfvdfhk@hotmail.com",username1@domaina.com," Spend money only
for the best quality. Buy software at OEM Software Store.","Deleted","Found
word(s) OEM Software in the subject"
What's the best way to go about creating a script that will scan the file
(by date) and send an email to the correct user? In this case username1
will receive an email with the first and last log entries and username 2
with the other one. There are many users on the server with quite a few
emails being deleted each day.
I appreciate any help.
Thanks...
--
Posted 'as is'. If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.
begin 666 log.txt
M(C$Q+S(Y+S U(# X.C4S.C Q(BPB06YT:2U3<&%M($ME>7=O<F0@0VAE8VMI
M;F<B+")V>&)H<69O=&YW;$!H;W1M86EL+F-O;2(L(G5S97)N86UE,4!D;VUA
M:6YA+F-O;2(L(E9I86=R82!0<F\@=VEL;"!M86ME('EO=2!H87!P>2!W:71H
M(&QI9F4B+")$96QE=&5D(BPB1F]U;F0@=V]R9"AS*2!V:6%G<F$@:6X@=&AE
M('-U8FIE8W0B#0HB,3$O,CDO,#4@,3 Z,C4Z,CDB+")!;G1I+5-P86T@2V5Y
M=V]R9"!#:&5C:VEN9R(L(F9U='IO;G-C<'%X0&AO=&UA:6PN8V]M(BPB=7-E
M<FYA;64Q0&1O;6%I;F$N8V]M(BPB4V]F="!#:6%L:7,@+2!I9&5A;"!R96UE
M9'D@9F]R(&EM<&]T96YC92XB+")$96QE=&5D(BPB1F]U;F0@=V]R9"AS*2!)
M;7!O=&5N8V4@0TE!3$E3(&EN('1H92!S=6)J96-T(@T*(C$Q+S(Y+S U(#$V
M.C$Q.C4W(BPB06YT:2U3<&%M($ME>7=O<F0@0VAE8VMI;F<B+")D<6YD=V9V
M9&9H:T!H;W1M86EL+F-O;2(L=7-E<FYA;64Q0&1O;6%I;F$N8V]M+"(@4W!E
M;F0@;6]N97D@;VYL>2!F;W(@=&AE(&)E<W0@<75A;&ET>2X@0G5Y('-O9G1W
M87)E(&%T($]%32!3;V9T=V%R92!3=&]R92XB+")$96QE=&5D(BPB1F]U;F0@
D=V]R9"AS*2!/14T@4V]F='=A<F4@:6X@=&AE('-U8FIE8W0B
`
end Tag: Delete dial up networking Tag: 184185
Can I compile / package up client side vbscript so an end user can't view it in a html file?
Hi,
Sorry if this is a stupid question, but I'm a bit new to vbscript...
We've got a client app written so it uses client side vb script in a few
html pages to provide basic functionality (don't ask why, someone else
designed it!). The problem is, you can do the classic 'right click, view
source' and find out exactly how it all works. Not too great eh?
My first question is: Is there a way to remove the vbscript and compile /
obfuscate it into a package which can be included into the project?
Now, we've also got a web site which is also vbscript heavy which has the
same problem. And so, same question again for this...
Thanks in advance,
Martin Pritchard Tag: Delete dial up networking Tag: 184177
automatically resize a window ? (xp)
I need to automatically size all open and non-mimized windows
(specifically Explorer folder navigation) to the specified height/width
(in twips or whatever unit). Also maybe include a function that reports
the height/width in twips or whatever of the topmost open non-mimized
window. Any idea how to do this from code in either vb.net, vb6,
vbscript... Tag: Delete dial up networking Tag: 184176
list and loop through files from just using an URL
Hi,
I would like to code in asp/vbscript, a program that will list each
file at a specific URL AND then allow me to loop through those files.
The folder on this remote browser would be set to "List Folder
Contents"
the problem is that the code using
_______________________
dim oxml
set oxml = createobject("msxml2.xmlhttp")
oxml.open "GET", "http://www.whatever.com/directorytobrowse/", false
oxml.send
response.write(oxml.responsetext)
_____________________________
just show returns the page with the listing of the files, which I can't
loop through the files
I would like some code that would allow something like this....
for each file in oxml
response.write(oxml.filename)
end
Thanks if anyone know how do this. (I would rather not parse through
oxml.reponsetext to try to extract the file names) Tag: Delete dial up networking Tag: 184173
Rename Windows 2000 computer
Hi,
I'm trying to rename a Windows 2000 computer in a NT 4.0 domain by vbscipt
code. But the code as far as I found is not compatible with Windows 2000.
Appreciate any help, thanks.
ErsinC Tag: Delete dial up networking Tag: 184172
remove exchange attributes
I have a vbscript that will create exchange mailboxes for my AD users.
I am interested in a script to remove those attributes. I am looking for a
way to automate the Exchange Tasks\Remove Exchange attributes task.
Hopefully someone can help me.
Paul Tag: Delete dial up networking Tag: 184169
Start Access Application from vbScript
I am totally new to vbScript.
I have an Access application that I want to kick-off using VBscript, but I
have not been able to figure out how to do it. I would like the script to
open the application in hidden mode, then execute the Autoexec macro that is
in the app.
Can anyone suggest a format for this operation? How about a good text for
someone that has been programming in VBA (mostly Access, but some Excel) for
about 7 years. Tag: Delete dial up networking Tag: 184168
Another Question:(
Hi Again Group,
I have the following code which deletes all file over 7 days old.
sDateTime = Year(dDate) & Right(100 + Month(dDate),2) _
& Right(100 + Day(dDate),2) & "_" & Right(100 + Hour(dDate),2) _
& Right(100 + Minute(dDate),2) & Right(100 + Second(dDate),2)
sFilename = sDateTime & ".zip"
'Delete OLD Data - This Keeps 7 Days worth of Backups
Set Folder = FSO.GetFolder("C:\zips\DataBackup\HFSdata")
For Each File in Folder.Files
If DateDiff("d", CDate(File.DateLastModified), Now()) > 7 Then
FSO.DeleteFile File
Next
What I would like to be able to do is if the file is Less than 24 Hours old
copy the Data to a Zip Disk on Drive Z:
I guess I would Add in something like:
If DateDiff("d", CDate(File.DateLastModified), Now()) > 7 Then FSO.CopyFile
File?? but I can`t find any info on the net tho:( Anybody kindly give me
some code or point me in the right direction?
Many Thanks
Regards
NSC Tag: Delete dial up networking Tag: 184167
Automatically Do IP and Docs
Hi Group,
Sorry if this is a simple on but im a newbie to all this scripting. I have
the following as part of my VB Script:
Const DriveLetter = "H:"
Const SharePath = \\10.109.220.10\c$\Documents and
Settings\Holderness.Road\My Documents
As Im deploying this to many machines, I would like to be able to
automatically get the Machines IP Address and Logged on Users My Documents
Path.
Could somebody possible point me in the right direction.
Many Thanks
NSC Tag: Delete dial up networking Tag: 184166
Pick List is displaying but cannot pick from
New to VBScript.
I've written a script which brings back a list of recent entires, the
idea beign our users pick the one they require rather than having to
remember their references. I've got the list to display but it doesn't
allow them to click on any. Code is below, where ABCDEF is our
database. Appreciate your help here, thanks.
-----------------------------------------------------------
sub main()
Set cnABCDEF = CreateObject("ADODB.Connection")
cnABCDEF.ConnectionString =
"ODBC;DATABASE=ABCDEF;DSN=ABCDEF;UID=xxx;PWD=xxx;APP=ABCDEF"
cnABCDEF.Open
Set cmdQuery = CreateObject ("ADODB.Command")
With cmdQuery
Set .ActiveConnection = cnABCDEF
.CommandText = "Select mattercode, matter from vw_refno where fe =
'JEH' and status = 'O' order by lasttime"
.CommandType = adCmdText
End With
Set matters = CreateObject("ADODB.Recordset")
Set matters.Source = cmdQuery
matters.Cursortype = adOpenForwardOnly
matters.CursorLocation = adUseClient
matters.LockType = adLockReadOnly
matters.Open
If matters.State = adStateOpen Then
Do While Not matters.EOF
strMsg = strMsg & matters.Fields("mattercode").Value
strMsg = strMsg & ":" & vbTab
strMsg = strMsg & matters.Fields("matter").Value
strMsg = strMsg & vbNewLine
matters.MoveNext
Loop
Matters.Close
MsgBox strMsg
Else
MsgBox "Recordset not opened"
End If
Set matters = Nothing
Set cmdQuery = Nothing
cnABCDEF.Close
Set cnABCDEF = Nothing
end sub Tag: Delete dial up networking Tag: 184165
Help, script to find user not logged in for a number of time (usiing LastloginTimeStamp)
Hi,
Well, my script (below) is supposed to find all user's on the domain
which have "password cannot expire" falgged, aswell as a list of all
users (by name) who have not logged on for a month.
If we only use the line:
(userAccountControl:1.2.840.113556.1.4.803:=65536); in the LDAP search
query, the script works fine, and returns a list of all user by name.
But when (lastLogonTimeStamp<= 127751249340000000) is added in the
search, the script returns nothing,
any advice would be great appreciated.
Regards
Khurram
Orion4_@hotmail.com
'
------------------------------------------------------------------------------------------------
' UserAudit_2.vbs
' Creates a report based on AD user properties for security auditing
purposes
'
------------------------------------------------------------------------------------------------
On Error Resume Next
'set parameters for ADOB Connection
Set objADConnection = CreateObject("ADODB.Connection")
Set objADCommand = CreateObject("ADODB.Command")
objADConnection.Provider = "ADsDSOObject"
objADConnection.Open "Active Directory Provider"
Set objADCommand.ActiveConnection = objADConnection
objADCommand.Properties("Page Size") = 1000
'connect to AD using LDAP, and search for users with
'the "ADS_UF_DONT_EXPIRE_PASSWD" flag (use value 65536)
objADCommand.CommandText = _
"<LDAP://DC=rfs,DC=nsw,DC=gov,DC=au>;" & _
"(&(ObjectCategory=Person)(objectCategory=User)(lastLogonTimeStamp<=
127751249340000000)(userAccountControl:1.2.840.113556.1.4.803:=65536));"
& _
"Name;Subtree"
'Define Record set
Set rsAD = objADCommand.Execute
'start at beggining of Record Set
rsAD.MoveFirst
'Print out the names of all users in RS
Do Until rsAD.EOF
Wscript.Echo rsAD.Fields("Name").Value
rsAD.MoveNext
Loop Tag: Delete dial up networking Tag: 184156
bug?
I found my .bat file setting environment variable from result of vbscript
but the value disappear right away/
bat file statements
@@rem some code that set up values for strdate with values like
strdate=Nov 29 18:38
echo %strdate%| For /F "usebackq tokens=1-2" %%i in (`cscript //nologo
"D:\util -misc\ConvertMMM_DD_HH_MM.vbs" `) do set DtRapidLstDnlod=%%i %%j
@@echo @debug newdt=%dtnew%
@@echo @debug DtRapidLstDnlod=%DtRapidLstDnlod%
@@echo stop for debug
@@rem end of bat file
Now I see output
c:\>set DtRapidLstDnlod=2005-11-29 %J
@debug newdt=Nov 29 18:38
@debug DtRapidLstDnlod=
stop for debug
here is the code for vbs file
dim newDt , sDt, str
str = wscript.stdIn.ReadLine
newDt = Cdate(str)
sDt = "" & newDT
if len(sDt) = 17 then
sDt = "20" & sDt
End If
wscript.echo sDt
what did I miss?
from the output the vbscript does seem to function correctly, but somehow,
the value of variable being set gets lost. and become some funny empty
value.
If I enter in command prompt
set dt
I get
DtRapidLstDnlod= Tag: Delete dial up networking Tag: 184155
Can I detect the Serial Number of a PC in a start up script
I would like to gather the Make, Model, and Serial Number of a PC during the
boot process. I am having difficulty doing so under restrictive user
accounts in my domain and am hoping a startup script running under the
system account would work.
Any ideas would be appreciated. Tag: Delete dial up networking Tag: 184152
List user's mapped drives on a remote PC
I'm trying to come up with a scripted methodology of listing the mapped
drives of the current user on remote PCs. I've found an article on Technet's
Hey Scripting Guys archive
(http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct05/hey1027.mspx
) that describes what I want to do perfectly. I have built my script around
this code, but have found that, although the article states "As usual, you
can modify this script to run against a remote computer simply by assigning
the name of that machine to the variable strComputer", you cannot enumerate
the shares on a remote PC (XP in this case) - the response always comes back
blank. The same methodology works great when run locally on the PC.
How would I go about listing the mapped drives used by the current user of a
remote PC?
TIA
--
Scott McWilliams
EDS Canada Tag: Delete dial up networking Tag: 184144
Option Explicit Issue
Hi,
I'm using Option Explicit to force all variables to be declared in my
script, however this doesn't seem to be the case. It seems from a
certain point forward in my script I can use variables without
declaring them first. Any idea what has happened here? I know this
obviously sounds a little odd, I'm sure there's a sensible solution to
whatever has happened.
Thanks,
Steve Tag: Delete dial up networking Tag: 184141
WMI Chipset Model and revision
Does anyone know how to get the Chipset model name (i845, i955) and revision
using WMI.
I've searched several classes but none returning this information. Whats
interesting is the registry has this info??? but it is stored differently
with each machine.
Thanks
C- Tag: Delete dial up networking Tag: 184136
How do I run this in VBscript?
I am trying to run this in a vbscript and i am not quite sure how to do
this, if I run it in a .bat file it runs no problem... any help would be
appreciated...
\\testdc\mailsend\MailSend -from test@test.com -smtp mail.test.net -to
test@test.com -msg "Your Files have been uploaded to the following FTP Site
ftp://192.168.0.1 please use the following username - test and password -
password to access the site. Thank You "
Thanks
Gavin... Tag: Delete dial up networking Tag: 184134
I am trying to delete a dial up networking connection via vbscript can
anyone help me out with the code for that.