script for changing language options
Hi! Is there a script for changing language specific options? I want to do it
buy connecting a start script to an OU in AD.
Or is there a better solution. My aim is to change the language on a
computer when a specific user logs in.
--
spitzer Tag: Vbscript.pdb Tag: 174027
Keyboard input?
Hello All
I'm trying to simulate a keyboard input of the letter "K" in my .vbs script.
Any idea how to do this?
Thank you, JB Tag: Vbscript.pdb Tag: 174024
How to refresh a Excel workbook with pivot & ADO query report in batch mode
I have a Excel report which as a report populated from a ADO VBA code
in a VBA subroutine which is driven from a button on the Excel
workbook which the user presses to refresh.
Also, I have some pivot reports on this workbook which is refreshed
from a VBA subroutine called from a Excel button.
Our users want this report to be refreshed in batch meaning they want
the report to be refreshed overnight and saved on the network share
that they can lookup the next morning without refreshing.
I am wondering if the workbook is called TestReport.xls and it as a
subroutine called RefreshAllReports please advise how to call this
Subroutine - RefreshAllReports in the Excel workbook - TestReport.XLS
from a VBScript from the operating system.
Please advise how I can implement this kind of scenario appreciate if
you can share the code to call a subroutine in a Excel workbook from a
VBScript.
Thanks
Karen Tag: Vbscript.pdb Tag: 174020
How to parse a email with attachment- Miyahn please help
Hi Miyahn
The script works well on Lotus 5.x on Lotus 6.5 it does not recognise
the Notes.Notessession I had to replace that by Lotus.Notessession and
then set
a Session.Initialise if I do not do this in Lotus 6 I get error in
creating ActiveX error.
When I put the above code the system expects me to provide a database
name and also it prompts for a password I want to run this script in
batch mode I do not want it to prompt for the password.
Thanks
Karen Tag: Vbscript.pdb Tag: 174017
ShellExecute fails to load & print microsoft products on XP!! (word/excel/powerpoint)
I am writing some code in Java that launches a VBScript to initiate
printing of selected files. Rather than write a custom bit of VB for
each known application, I decided to use the ShellExecute function.
The problem is, this works on my development machine (Win2K), but I
cant get it to work on XP Home, XP Pro (SP1) or XP Home (SP2).
STRANGELY, if I try to launch anything other than .doc, .ppt, .xls it
seems to work! - Thanks Microsoft! ;-)
Any suggestions? I dont think I can use the 'run' alternative, as that
doesn't allow me to specify the 'print' parameter.
FYI, typing test.doc in DOS or in the 'start->run' section DOES launch
word, so I know the associations are ok.
ATTEMPT 1:
dim objShell, filesys, manifestFile, filetext
set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "C:\test.doc", "", "", "print", 1
set objShell = nothing
ATTEMPT 2:
dim objShell, filesys, manifestFile, filetext
set objShell = CreateObject("Shell.Application")
CreateObject("Shell.Application")_
.Namespace(0)_
.ParseName("C:\test.doc")_
.InvokeVerb "&Print"
set objShell = nothing Tag: Vbscript.pdb Tag: 174016
How to send a email with a attachment to Lotus Notes
Torgeir
This script again works fine on Lotus 5 on my a Lotus 6.5 system it
prompts for my password and also it expects me to specify the database
name.
Please help how do I resolve this.
Thanks
Karen Tag: Vbscript.pdb Tag: 174015
Remotely searching for files
Thanks Torgeir Bakken for your help. I finally figured it out and i
been a big help.
Torgeir Bakken \(MVP\) wrote:
> *nnanna wrote:
> > Thanks for the script Torgeir Bakken.
> > I modified it and was getting access denied on Line 45.
> > Any ideas why?
> Hi
>
> I assume that line 45 is the Set fStatusFile ... line in
> this code block:
>
> ' Create status file
> Set fStatusFile = oFSO.CreateTextFile(sStatusFile, _
> OverwriteIfExist, OpenAsASCII)
>
>
> Be sure that you have write access to the path you have put in
> the sStatusFile variable.
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> [url]http://www.microsoft.com/technet/scriptcenter/default.mspx[/url
>
-
nnann
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
----------------------------------------------------------------------- Tag: Vbscript.pdb Tag: 174014
How to parse a email with attachment- Miyahn please help
Hi Miyahn
Thanks again for your prompt reply.
Please note the code you have posted works fine on Notes 5.x when I
use it against Notes 6.x it does not work.
Please clarify what is HTA sorry for my ignorance how to use HTA. I
would be thankful if you could help me in getting the code you posted
to work with
Notes 6
Thanks
Karen Tag: Vbscript.pdb Tag: 174013
Linking login scripts in VBS
Hi
I would like do have a common loginscript and in that script link to other
scripts according to e.g. the membership to an AD group.
Could be like this in pseudo
<<Common login script
map common network drives
distribute common templates and documents
if memberOF("technicians1") then runscript("tech1.vbs") else
if memberOF("technicians2") then runscript("tech2.vbs")
if memberOF("admin") then runscript("admin.vbs")
etc.
Is there an example somewhere?
TIA
Henry Tag: Vbscript.pdb Tag: 174010
Read Account Details From Outlook Profile In Registry
Hello everyone,
I am trying to read the Outlook 2000/XP account details from the registry
using VBScript (WSH specifically), so I can then import the information into
an asset management tool. The script below works perfectly for Outlook
Express, but for Outlook the values are stored as reg_binary, and when I run
the script I only get the binary string returned (or more often a whole
bunch of frustrating errors!!!)
In my case, the Outlook profile date is stored in:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows
Messaging Subsystem\Profiles\Microsoft Outlook Internet
Settings\9375CFF0413111d3B88A00104B2A6676\00000006
Could someone please show me how to transform the binary string values
into a text string similar to the script below? I have spent about a week
trying all sorts of code from just about every source and none of it
works!!! From searching on the web I have noticed a lot of people trying to
do the same thing and failing, so it would be great to finally have a
solution!!
Many, many thanks in advance, and I hope you all have a nice day!
David
' *********** BEGIN CODE
' Code originally by Michelle Hillard (mhillard@craized.tv)
' Many thanks Michelle!
dim key,defaultAccount,emailAddress
Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")
on error resume next
key="HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\"
defaultAccount=WSHShell.RegRead (key & "Default Mail Account")
If err<>0 Then
MsgBox "Email Settings Not Found!"
else
emailAddress=WSHShell.RegRead (key & "Accounts\" & defaultAccount &
"\SMTP Email Address")
emailName=WSHShell.RegRead (key & "Accounts\" & defaultAccount & "\SMTP
Display Name")
pop3uname=WSHShell.RegRead (key & "Accounts\" & defaultAccount & "\POP3
User Name")
SMTPServer=WSHShell.RegRead (key & "Accounts\" & defaultAccount &
"\SMTP Server")
POP3Server=WSHShell.RegRead (key & "Accounts\" & defaultAccount &
"\POP3 Server")
'MessageText="Your Default Email Address is " & emailAddress & " (" &
emailName & ")"
'MsgBox MessageText
wscript.echo emailAddress
wscript.echo emailName
wscript.echo pop3uname
wscript.echo SMTPServer
wscript.echo POP3Server
end if
' ********* END CODE Tag: Vbscript.pdb Tag: 174009
MsgBox Help for Newbie (Isn't it always)
Please help a scripting newbie as I can't get my head around (I would
guess) a simple concept. I want to run a script that when runs,
displays a MsgBox with the users logon name. Ive worked this out
Set oShell = CreateObject("WScript.Shell")
MsgBox oShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\Currentversion\Winlogon\DefaultUserName")
What I want to do is simply add a few values under this output. For
example "You agree to use this network" and "Dont dissapoint me" ;-)
Using the & vbCrlf "value here" appended to the above just doesn't
work. What am I missing?
Seriously, I would love a pointer on this before I get
straightjacketed. Thanks, Jonce. Tag: Vbscript.pdb Tag: 174004
How to parse a email with attachment- Miyahn please help
Hi Miyahn
Many thanks for your code.
But this does not work on Lotus 6 not sure what Lotus COM objects have
changed it says it cannot create ActiveX components I did regsv on
various notes components does not work.
The above code work on Lotus5 not on 6 appreciate your help if you
could resolve to get it to run on Lotus 6
Thanks
Karen Tag: Vbscript.pdb Tag: 173991
More Scripting Questions
First off, thanks to everyone for helping a newbie out. I've learned alot
as I go along. I've got two more questions for the group:
1. My script calls a batch file and then after it I want it to pull up a
msgbox saying it's done. The problem is that as soon as the batch file
starts, the msgbox pops up. How can I get the script to pause until the
batch file is complete? I've temporarily used the sleep command to estimate
how long it takes now, but as time goes on, the batch file will take longer
and longer and I would have to keep changing the sleep setting. Here's the
code:
set objshell=createobject("WScript.Shell")
objshell.run "batchfile.bat"
wscript.sleep 17000
msgbox("Scan Complete.")
2. My script winds up creating two text files and compares them to see if
they are the same or different. Is there any command or method to discern
exactly what's different about the files? Like the diff command in UNIX? Tag: Vbscript.pdb Tag: 173988
log file script
Any chance someone can help me out wih a script? I need the script to
look in a text file for a server name, connect to the server, check the
size of the application security and system log files, if it is over a
certain size copy it to another directory, then clear the log. After
that, go back to the list of servers and do it for the next one.
Thanks
--
h22hatch
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------ Tag: Vbscript.pdb Tag: 173980
Script to uninstall software
Hello,
Please post a script how to uninstall software from computer. Software is
McAfee Antivirus
Thanks Tag: Vbscript.pdb Tag: 173978
Locate where user is logged on
probbbbably a dumb question! but is it possible to find/get the computer
name where a particular user is logged in or find out who is logged in
on a particular computer.
tia
*** Sent via Developersdex http://www.developersdex.com *** Tag: Vbscript.pdb Tag: 173977
How to verify a dll has been unregistered/registered
Hi,
I am trying to unregistered a dll on many servers via a script remotely.
As a QA process how to remotely verify the dll has been unregistered
sucessfully ?
My command:
regsrv32 /u /s name.dll
Thanks,
Wensi Tag: Vbscript.pdb Tag: 173975
OT: (ish) MySQL Front End software
Hi,
I hope this isn't too off topic! I'm looking for some free software to use
as a front end for MySQL version 4.1.10 . I currently use MySQL-Front but
this only supports my older database.
Does anyone know where I could get hold of the right software?
Thanks
Andrew Tag: Vbscript.pdb Tag: 173974
Everyone Shares
I'm in need a vbscript that I can work with that identifies the shares
on a computer that has everyone set with full control permissions. I
can then feed it the list of 100 or so servers that I need to run this
script on several times per year. I know there are some utilities out
there like xcacls, but I simply don't have the time to write a parsing
script to parse the output, and our file server alone has 1500+ shares.
Does anyone have anything they can help me get started with. Please
try to stay with vbscript - that's really all I do well. Thanks! Tag: Vbscript.pdb Tag: 173972
Script to remove service
Hello,
Could someone please send me a script to remove service, here is manuall way
of doing it from cmd:
c:\programs*\network*\common*\frminst.exe /forceuninstall
so basically i would need a script that would call this command
please help
Thanks Tag: Vbscript.pdb Tag: 173964
quick sort of 3-d array
Hi there,
I want to sort an array:
Array(id, name, price)
by the 'price' field
I've looked up sort code on the net (for classic asp - vbscript), but
the QuickSort code I found (on 4guysfromrolla) was giving me a
memory-stack overflow error (my array only has around 50 rows)
or was only designed for 2-d arrays.
Anyone got a url of sort code for the above 3-dimensional array?
It doesn't even have to be Quick Sort since it's backend stuff and I
don't mind waiting for a Bubble sort,etc
Cheers,
Peter
--
"I hear ma train a comin'
... hear freedom comin" Tag: Vbscript.pdb Tag: 173962
Any LDAP and DNS experts out there?
This simple code queries one of our DDNS domains using LDAP and
attempts to get the IP address for a printer. It finds the printer
with no problem and I can dislpay the printer using the "name" field
(code is omitted) but what I also want is the IP address. It is stored
in the "dnsRecord" field and is the last 4 sets of numbers. If I could
just get those numbers I could parse/convert/ change the heck of them
but I can't get anything from the dnsRecord field. all I get are two
boxes which I can't type since they lijke some obscure ASCII but they
are certainoy not numbers. Maybe I am reading an object from LDAP
which needs further work? I dont know. however if I use
"adsiedit.msc" I can see the numbers in the dnsRecord field I can't
can't query them or display them with my code... heelppppp
here's the code:
'------- Declare variables --------
Set cnvt = CreateObject("ADs.ArrayConvert")
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"
Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection
'------- Run LDAP query -------
objCommand.CommandText = _
"<LDAP://DC=usfca.printer,CN=MicrosoftDNS,CN=System,DC=ds,DC=usfca,DC=edu>;(&(DC="
& "hr" & "545" & "*))" & ";dnsRecord;subtree"
Set objRecordSet = objCommand.Execute
'------- Parse the resultant query and display the results -------
While Not objRecordSet.EOF
Wscript.Echo join(objRecordSet.Fields("dnsRecord"))
objRecordSet.MoveNext
Wend
objConnection.Close Tag: Vbscript.pdb Tag: 173960
script not run if OS is server?
I have a vbs login script that I am working on implementing onto a domain via
group policy. However, I do not want this script to run if the user is
logging onto a server. Just workstations. Servers are not grouped alone in
any OU's and while AD is being reorganized, it won't be completed by the time
the script needs to be implemented. Any recommendations on how to implement
the login script for workstation only?
Thank you for your time. Tag: Vbscript.pdb Tag: 173959
vbScript error: 0x8004010F while parsing mailitems.
Hello,
I have a vbScript that parses emails (within a PST) via Outlook 2003...
Occasionally, the script will terminate with the following error:
xxxx(127,16) (null): 0x8004010F
Line 127 is as follows:
If Instr(1, objItem.Body, strKeyword, vbTextCompare) > 0 OR Instr(1,
objItem.Subject, strKeyword, vbTextCompare) > 0 Then
Any idea what the error code is indicating?
Troy Tag: Vbscript.pdb Tag: 173958
Searching excel or txt file for duplicate entries
Would anyone have a way to search an excel or text file for duplicate
entries such as 2 lines with the same email address or employee ID. I have a
file with 13000 users, 1 per line and I need to identify the duplications so
I can clean them up. I really only need to search 1 column and the
duplicates are next to each other top to bottom.
I can pull the file apart if I need to and put only the email addresses
into a text file, even that would be faster and less mind numbing than
looking at all 13000 manually...
Thanks in advance,
S-
--
Sean M. Loftus
Enterprise Architect
Loftus Consulting, Inc.
www.LoftusConsulting.com
sean(removeme)@loftus.org Tag: Vbscript.pdb Tag: 173956
Help ! Wrong Number of properties or invalid property assignment !
hi ,
I have written a follwing script :
Dim i,j,ub
ub = ubound(evnt.replacementParameters)
For i=0 to ub
j = evnt.replacementParameters(i)
.............
.............
Next
Where evnt.replacementParameters is an array of strings.
When debugging I can see upper bound as 3 and lower bound as 0.
But I am getting error at statement,
j = evnt.replacementParameters(i)
which says "Wrong Number of properties or invalid property assignment " with
err.number = 450.
I am not able to find what's going wrong!!?
While debugging , Watch for evnt.replacementParameters shows me all the four
values in that array,
but watch for evnt.replacementParameters(0) and evnt.replacementParameters(1)
shows empty!!!
Any help would be appreciated.
Thanks in advance. Tag: Vbscript.pdb Tag: 173953
Reading txt files and deleting them
Can someone help me finish this script? I am trying to read txt files in a
directory and if the file contains "2.0" I want to delete the file. Thanks!
Option Explicit
Const ForReading = 1
Const Folder = "G:\Scripts\SP\"
Dim oFSO
Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")
Dim oGF
Set oGF = oFSO.GetFolder(Folder)
Dim oTF
Dim oTS
Dim oRL
For Each oTF In oGF.Files
If(Right(oTF.Name,3)) = "txt" Then
Set oTS = oFSO.OpenTextFile(Folder & oTF.Name, ForReading)
oTS.Read("1.0")
Do While Not oTS.AtEndOfStream
Loop
oTS.Close
End If
Next Tag: Vbscript.pdb Tag: 173952
adding password to ODBC
Does anyone know a way to script the adding of a password to a ODBC DSN sql
authentication data source?
I'm struggling and any help would be greatly appreciated.
Thanks,
Jeremy. Tag: Vbscript.pdb Tag: 173950
logon scripts for idiot
Hi I hope someone can help.
Im new to this so bear with me if Im dumb
I work in a school and I need to write a logon script to
map various drives for various users.
I have a domain called christchurch.local
A server called DELL
I have 4 folders to share 1) Class Work 2)shared 3) admin
programs 4) SIMS.
I have 10 users year 1 - year 8 -staff - administrator
I want to map Class work to year 1 - 8
I want to map Class work and Shared to staff
And map everything to administrator
I also want to map 2 TCP/IP printers Colour Laser Printer
on 10.122.x.x and Mono Laser Printer on 10.122.x.x
can anyone help me? i seem to be vbs dyslexic Tag: Vbscript.pdb Tag: 173949
Using VBScript to send message using CDO.message
Ok, I don't get this. I used the stock script from the Script Center
repository for sending a message on my PC and it works. I use it on a
Windows 2003 server and it won't. I'm getting this message:
CDO.Message.1: The "SendUsing" configuration value is invalid.
What's this mean? I thought it was because Outlook wasn't installed on the
server. Well, a full-blown install is now there and I STILL get this problem.
The code is just this easy and nothing but the Script Center website sample:
Dim objEmail
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "server@mycompany.com"
objEmail.To = "jms@mycompany.com"
objEmail.Subject = "Something didn't work!"
objEmail.Textbody = "The import at " & now & " failed."
objEmail.Send
Set objEmail = Nothing Tag: Vbscript.pdb Tag: 173942
com-enum
hello
im using a com-server-dll in vb script.
my problem is how to use the defined enums in the dll?
the tlb looks like this:
typedef [uuid(2A0CC5DF-448E-351B-8136-2772C265D95B), version(1.0),
custom(0F21F359-AB84-41E8-9A78-36D110E6D2F9,
testWrapper.Styles+LineStyles)
]
enum {
LineStyles_Normal = 0,
LineStyles_Strichpunkt = 1,
LineStyles_StrichStrich = 2,
LineStyles_PunktPunkt = 3
} LineStyles;
i get the server-instanze via CreateObject.
after that i can access the methods but how to use the enum-fields?
btw.: enum-parameter in the com-dll-interface are mapped to integer-value
but i think thats a com-thing and no further problem
thanks
micha Tag: Vbscript.pdb Tag: 173941
Object required error
Hi
I'm a VB newbie does anyone know what I'm doing wrong in this script?
Dim hostcompname
Dim WshNetwork
Set WshNetwork =Wscript.createObject("Wscript.Network")
'WshNetwork.MapNetworkDrive "H:", "\\server\faelles"
'WshNetwork.MapNetworkDrive "I:", "\\server\clientapps"
'WshNetwork.MapNetworkDrive "J:", "\\server\Administration"
Set hostcompname = WshNetwork.ComputerName
Last line results in this error 800A01A8, object required??
TIA Henry Tag: Vbscript.pdb Tag: 173931
Problem with script.
Hello I want to disable some user account in domain, I take users from
Excel, and this is OK, but please look bottom -> this is the problem.
Please Help
Thanks for all
Best regards
Thomas
'[Something in top]
Sub DisablingUser(name)
strUserName = name
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"
Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection
objCommand.CommandText = _
"<LDAP://dc=domain,dc=org>;(&(objectCategory=User)" &_
"(name=" & strUserName & "));distinguishedName;subtree"
Set objRecordSet = objCommand.Execute
While Not objRecordSet.EOF
'This is block with I have problems
people = objRecordSet.Fields("distinguishedName")
Set objUser = GetObject("In this moment I want variables from people ") '
This is the clue
intUAC = objUser.Get("userAccountControl")
objUser.Put "userAccountControl",ADS_UF_ACCOUNTDISABLE
objUser.SetInfo
objRecordSet.MoveNext
Wend
objConnection.Close
End Sub Tag: Vbscript.pdb Tag: 173929
This script to send mail to Lotus Notes does not work for R6
I tried the following script against a Notes 5 system it works but
against a notes 6 system this just does not work.
I get the message : "ActiveX component can't create object:
"Notes.NotesSession"
I replaced this by CreateObject("Lotus.NotesSession")
the error goes then I get the message the session is not initialised
now I put in the following
nSession = Call nSession.Initialise("password")
without password it does not work I do not want to be prompted for
password. After this none of the remaining lines work in the following
code against R6.
Set nSession = CreateObject("Notes.NotesSession")
session.initialise
'Gets the current user's maildatabase
Set db = nSession.GETDATABASE("","")
Call db.OPENMAIL
Set doc = db.CREATEDOCUMENT
Call doc.REPLACEITEMVALUE("SendTo", "Fn Ln/CA/ABC@ABC.com")
Call doc.REPLACEITEMVALUE("Subject", "Mail checked")
Call doc.REPLACEITEMVALUE("Body", "Did you get it")
Call doc.SEND(False)
can any of you kindly share a working code for R6 VB script to send
and receive mails from Lotus Notes
Thanks
Karen. Tag: Vbscript.pdb Tag: 173928
Remotely searching for files
Thanks for the script Torgeir Bakken.
I modified it and was getting access denied on Line 45.
Any ideas why?
Torgeir Bakken \(MVP\) wrote:
> *nnanna wrote:
>
> > I use the code below to query each sever, but I would love to run
> it
> > remotely and the result written to a log file. Any ideas?
> > (snip)
> Hi,
>
> Please see my first post in this thread...
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> [url]http://www.microsoft.com/technet/scriptcenter/default.mspx[/url]
> *
--
nnanna
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------ Tag: Vbscript.pdb Tag: 173924
How to send a email with a attachment to Lotus Notes
The following code works for sending email to a Lotus Notes email
user.
Set nSession = CreateObject("Notes.NotesSession")
'Gets the current user's maildatabase
Set db = nSession.GETDATABASE("","")
Call db.OPENMAIL
Set doc = db.CREATEDOCUMENT
Call doc.REPLACEITEMVALUE("SendTo", "Fn Ln/SRV01/SOC@ABC.com")
Call doc.REPLACEITEMVALUE("Subject", "Test message")
Call doc.REPLACEITEMVALUE("Body", "Did you get it correctly")
Call doc.SEND(False)
I want to be able to send attachments like a .TXT or .XLS file
attachment to a user.
I would greatly appreciate if you could share the code to add to this
to send a attachment file to a Notes user.
Thanks
Karen Tag: Vbscript.pdb Tag: 173921
How to parse a email with attachment- Miyahn please help
Hi Miyahn
The code here works fine to extract the email but my problem is I want
to extract a text file attachment that comes with the email.
I would greatly appreciate if you could share the code that enables to
download the attachment which is a text file to a folder than just
parse the email.
Thanks
Karen
Subject: Re: How to parse a email and reply to the parsed email
View: Complete Thread (4 articles)
Original Format
Newsgroups: microsoft.public.scripting.vbscript
Date: 2004-10-23 21:21:24 PST
"Karen Middleton" wrote in message news:a5fd468a.0410231756.4f62dcb9@posting.google.com
> > What email system are you running?
>
> Unfortunately we are running Lotus Notes I know it is not the best
> system to use but we are struck with it.
I can't understand your hope completely, because of my poor English
ability.
So, the following script may not be helpful.
I use this script to check new Notes mails in plain text.
(Of course, in the Notes of Japanese edition.)
Pay attention to the comment lines before you try it.
Dim FS, WS ,aFile, nSs, nDb, nVw, nDoc
Dim MailServer ,MailFile, From, dDate, Title, Body, Buf
Dim oFile, tFile, LastTime
oFile = "NewMail.txt": tFile = "LastTime.txt"
Set WS = CreateObject("WScript.Shell")
If Not WS.AppActivate("Lotus Notes Desktop") Then
' ^^ This line should be modified by the 'Notes' version
MsgBox "The 'Notes' isn't running"
Set WS = Nothing: WScript.Quit
End If
LastTime = "2004/10/24"
' ^^ This line should be modified by DateTimeFormat of the system
Set FS = CreateObject("Scripting.FileSystemObject")
If FS.FileExists(tFile) Then
Set aFile = FS.OpenTextFile(tFile, 1)
LastTime = aFile.ReadLine
aFile.Close
End if
Set aFile = FS.CreateTextFile(tFile)
aFile.Write Now & vbCrLf
aFile.Close
Set nSs = CreateObject("Notes.NotesSession")
MailServer = nSs.GetEnvironmentString("MailServer", True)
MailFile = nSs.GetEnvironmentString("MailFile", True)
Set nDb = nSs.GetDataBase(MailServer, MailFile)
Set nVw = nDb.GetView("($Inbox)")
Set nDoc = nVw.GetFirstDocument
On Error Resume Next
Do Until nDoc Is Nothing
dDate = nDoc.GetFirstItem("DeliveredDate").Text
If CDate(dDate) > CDate(LastTime) Then
From = nDoc.GetFirstItem("PName").Text
' ^^ This line may be modified by mail database template.
Title = nDoc.GetFirstItem("Subject").Text
Body = nDoc.GetFirstItem("Body").Text
Buf = Buf & "Sender : " & From & vbCrLf
Buf = Buf & "Subject : " & Title & vbCrLf
Buf = Buf & "Date : " & dDate & vbCrLf
Buf = Buf & "Body : " & vbCrLf & Replace(Body, vbLf, vbCrLf) &
vbCrLf
Buf = Buf & String(65, "=") & vbCrLf
End If
Set nDoc = nVw.GetNextDocument(nDoc)
Loop
Set nDoc = Nothing : Set nVw = Nothing : Set nDb = Nothing
Set nSs = Nothing
If Buf = "" Then
MsgBox "No new mail"
Else
Set aFile = FS.CreateTextFile(oFile)
aFile.Write Buf
aFile.Close
WS.Run oFile
End If
WScript.Quit
--
Miyahn (Masataka Miyashita) JPN
Microsoft MVP (Office Systems - Excel)
HQF03250@nifty.ne.jp Tag: Vbscript.pdb Tag: 173920
Can this GP change be scripted?
In Group Policy Computer Configuration, you can right-click an IP Security
Policy and either 'Assign' or 'Un-assign' it. Does anyone know if these
'Assign' and 'Un-assign' selections can be scripted?
Thanks... Tag: Vbscript.pdb Tag: 173916
script out of time?
hi
i have the following script which takes a server list, splits it up, maps a
drive to each server and checks the date last modified of a particular file
seems ok except for one strange issue
server1's file has a dlm of 11/04/05
server2's file has a dlm of 28/04/05
when i run the script it reports back the other way round. i.e. server1 as
28/04/05 and server2 as 11/04/05
the map.cmd command removes the current L: mapping and maps to servlist(x).
this is OK as i have generated an audit file from this and it maps the
correct way around (i.e. server1 first followed by server2)
any ideas?
cheers
option explicit
Dim WshShell, fso, file, lmdate, servfile, servlist(30), sl, x, y, server
set WshShell = createobject("wscript.shell")
set fso = createobject("scripting.filesystemobject")
set file = fso.getfile("L:\myfile.vbs")
set servfile = fso.opentextfile("serverlist.txt",1)
x = 0
Do While Not servfile.AtEndOfStream
sl = servfile.readline
servlist(x) = sl
x = x + 1
loop
y = x
x = 0
for x = 0 to eval(y-1)
wshshell.run "map.cmd "&servlist(x),true
lmdate = file.DateLastModified
lmdate = left(lmdate,10)
if lmdate = "11/04/2005" then
msgbox servlist(x)&" "&lmdate
else
msgbox servlist(x)&" wrong date"
end if
next Tag: Vbscript.pdb Tag: 173911
Embed a spreadsheet
Is there a way to display an Excel spreadsheet in an hta?
Also, can one create Tabs in an hta.... One for user input data and another
to display the result of my script?
I'm also looking for good website on scripting and hta programming.
Thanks.
Daniel Tag: Vbscript.pdb Tag: 173904
Login Script to Disable Password When Resume From Standby
When our workstations resume from standby, users are prompted for a password.
The client OS is XP Pro. The setting is on the Advanced tab in Power Options,
which needs admin priviledges to change, which they do not have.
We have been trying to stop this and have hit nothing but dead ends.
1- We tried powercfg.exe with the proper switches- only works for admins.
If anyone knows of a solution (script, registry mod, adm file, anything), I
would be extremely gratefull for your wisdom. Tag: Vbscript.pdb Tag: 173903
scripting events
Hi, I consider myself a newbie to vbscript. Been working with VBA for a bit
however. I'm trying to see if I can interact with applications using event
based code. An example of such is:
'Snip******************************
Option Explicit
Dim objExcel
Dim i
Set objExcel = CreateObject("Excel.Application")
WScript.ConnectObject objExcel,"objExcel_"
objExcel.Visible = True
objExcel.Workbooks.Add
i = 0
Do
WScript.Sleep(100)
i = i + 1
Loop While (i < 100)
WScript.Echo("Script Complete")
Sub objExcel_WindowActivate()
WScript.Echo("WindowActivate")
End Sub
'Snip******************************
I tried referencing some of the articles in the library, but I think I wound
up confusing myself. The above code just returns an error that it can not
connect to the object. If I use WScript.CreateObject("Excel.Application",
"objExcel_") instead, it compiles, but does not respond to events. Any
pointers for a newbie?
-J Tag: Vbscript.pdb Tag: 173897
How to find network places on a network
and find other computers, list them and attempt to connect them (or
list ip-name datas)with vbs (inside HTA)?
Thank you
Caglar Orhan Tag: Vbscript.pdb Tag: 173896
Copy file on a file server not on domain using IP address
I need to copy a file on a file server that is not on the domain to the
local machine using IP address and login ID/password. Is this possible
using vbscript? Thank you for your help. Tag: Vbscript.pdb Tag: 173891
Remove selected items from listBox
I have populated A listbox with a list of processes.
After selecting i click a button to kill the selected processes.
>>Can anyone tell me how i can refresh the listbox.<<
I've tried simply by re-populating the listbox as i did above but the
highlighted selections still show and i end up with double the amount of
processes showing.
hope u can understand this!!!
thanks in advance
so far i have ....
Sub Window_Onload
document.body.style.cursor = "wait"
'Get processes
strComputer = "."
Set colProcesses = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & _
"\root\cimv2").ExecQuery("Select * from Win32_Process")
For Each objProcess in colProcesses
Return = objProcess.GetOwner(strNameOfUser)
If strNameOfUser = "Ben" then
Set objOption = Document.createElement("OPTION")
objOption.Text = objProcess.Name
objOption.Value = objProcess.Name
Processess.Add(objOption)
End If
Next
document.body.style.cursor = "default"
End Sub
*** Sent via Developersdex http://www.developersdex.com *** Tag: Vbscript.pdb Tag: 173889
ASPUpload problem
I'm using ASPUpload to upload a file to my server, and then to auto email it
to me, and it works fine except for one part. The start of the code is shown
below, and you will see that I have set it to only accept .doc or .txt
files.
If a file other than these is sent, the user gets the correct message saying
it's not the correct file type, and I don't get the email (which is right),
but the file IS being uploaded to my server, so I could end up with any type
of ile in there.
Could anyone explain how I can tweak the code blow so that the file doesn't
make it on to my server (which I assume is what the "File.Delete" part of
the code is supposed to do!
Thanks
Andrew
<%
DIM File, Upload, Count, Ext
DIM Mail, strMsgHeader
Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.OverwriteFiles = False
Count = Upload.SaveVirtual("cv_files/")
IF NOT Count=0 THEN
FOR EACH File IN Upload.Files
Ext = UCase(Right(File.Path, 3))
IF Ext <> "TXT" AND Ext <> "DOC" THEN
response.Redirect("contact_not_sent.asp")
'Response.Write "Sorry, your CV is not in a .DOC or .TXT format and has
not been delivered through our system. Please save your CV in one of these
formats and resubmit it. Alternatively, please send an email and attach your
CV using the email link on this page."
File.Delete
ELSE
...rest of code here..... Tag: Vbscript.pdb Tag: 173887
Could sometime tell me how to get hold of the latest version of the
public symbols for vbscript?