parsing xml
I need some help parsing thorugh an xml file and then take the results and
write to a formatted xml file. I made some effort. The xml sample is below.
The purpose of xml defines all the property classes we want to pull data
for. The code below actually grabs the property class. I don't know how to
read the second argument(true/false) What I would like to happen is read all
the classes but before continuing to get the values is validate wether or
not I should get values based on the true or false argument. The purpose is
to have all the properties availiable and decide what we actually want to
grab. After validating if we should pull class data, I then need to look at
each Property PName and determine if I should grab only certain pieces are
everything based on the true/false. As I cycle through each Class and get
data, I want to write that info to another xml file.(End of file with dummy
values.)
'Main
Sig()
Function Sig()
'************************************************************
' Name: Sig
' Purpose:
' Inputs: None
' Returns: None
'************************************************************
Const StoreXML_DROPOFF_DIR = "C:\"
Const StoreXML_FileName = "NewXML.xml"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set xml = CreateObject("Microsoft.XMLDOM")
XML.async = False
XML.load StoreXML_DROPOFF_DIR & StoreXML_FileName
Set classes = XML.selectNodes("//SIGInventoryData/Class")
'numNodes = nodeList.Length
'For i = 0 To nodeList.length -1
For Each pclass In classes
className=pclass.Attributes.getNamedItem("CName").value
Set myNode = pclass.selectSingleNode("Property")
FindNodeValue = myNode.Text
WScript.Echo (className)
WScript.Echo(FindNodeValue)
Next
End Function
************************
Template xml file on what data to capture - Newxml.xml
************************
<SIGInventoryData>
<Class CName="LCD" CInventory="True">
<Property PName="brightness" PInventory="True"/>
<Property PName="backlight" PInventory="false"/>
</Class>
<Class CName="Audio" CInventory="True">
<Property PName="volumelevel" PInventory="True"/>
</Class>
</SIGInventoryData>
**********************************************
The format of the xml file with data pulled from template xml.
**********************************************
<Class CName="LCD">
<Property PName="brighness" Value="32"/>
</Class>
<Class CName="Audio">
<Property PName="volumelevel" Value="9"/>
</Class> Tag: user account status Tag: 174048
how to use vbscript from ole control?
I am programming on a third party language that does not have some of the
built-in functionality (regexp) I need from vbscript
I ran into trouble in setting eh language displID for the WSScript.Control
Can some one show me? I try Google but no luck so far, the script56.chm did
not help me either. I was not using the right search term Tag: user account status Tag: 174046
Setting the default saved file locations for Office 2003
My company has roughly 700 + users. We have Office 2003 pushed through GPO
to all of the pc's. I want to make a script for word, excel, powerpoint and
access to save at certain location. The script will be ran manually after
the image and push have been performed. If you have any direction or ideas
on this please feel free to help. Tag: user account status Tag: 174044
LDAP question
I am trying to learn how to access AD objects using scripts and do not
understand why I am getting the responses that I am seeing. The script
is:
Dim objDomain
Set objDomain = GetObject("LDAP://dc=rcmt,dc=com")
WScript.Echo objDomain.Get("pwdHistoryLength")
WScript.Echo objDomain.Get("maxPwdAge")
Set objDomain = Nothing
The first echo works fine, telling me that the Password History is set
to 3. However, the second echo (and almost every other attribute that
I'm interested in) gives me a type mismatch error.
I'm following examples from a scripting book and do not understand what
I'm doing wrong. Any help would be greatly appreciated. Tag: user account status Tag: 174043
Get server-based printer list from clients
I have a script that I run from a client, and I get all printers: local, IP
based, server-based.
If I run the same script from a server, I get the local and IP Based, but
not server based.
Does anyone have a script that will enumerate the printers on a remote
machine that includes server based printers? Tag: user account status Tag: 174042
how to set script language on a script control
1. What is the proper dispIDmember name I can use to set the Language?
The ones I used did not work.
If I don't set language, I get
---------------------------
Windows Script Host
---------------------------
Script: c:\documetn and setting\smith\Local Settings\Temp\z.vbs
Line: 11
Char: 1
Error: The operation could not be completed because the script engine has
not been initialized to a valid language.
Code: 80004005
Source: ScriptControl
---------------------------
OK
---------------------------
If I try settign the language with any of the names I used I get something
like:
---------------------------
Windows Script Host
---------------------------
Script: c:\documetn and setting\smith\Local Settings\Temp\z.vbs
Line: 10
Char: 2
Error: Object doesn't support this property or method: 'Language'
Code: 800A01B6
Source: Microsoft VBScript runtime error
---------------------------
OK
---------------------------
For example:
Dim objVbscript
' Dim is_ScriptControl = "MSScriptControl.ScriptControl"
' set objVbscript = CreateObject("VBScript.Control")
set objVbscript = CreateObject("MSScriptControl.ScriptControl") ' works
' XX objVbscript.Language("VB Script Language") ' non of these 3
statemetns work
' objVbscript.Language("VBScript")
' objVbscript.Language("{B54F3741-5B07-11cf-A4B0-00AA004A55E8}")
objVbscript.Reset()
' -------------------------------- end of test script --------------------
What I am trying to do to to debug the protocol so I can call the scirpt
control from another programming language and use the script control to
execute some vbscript. Do I really need reset()?
If anyone has experience in this area, I will appreciate very much some
samples or some pointers. Tag: user account status Tag: 174041
need script to automate creation of DFS
I have a need for a user creation script. Let me explain.
I am planning a migration from Novell to Microsoft. We are going to use DFS
to help with our User's File access.
So I need a script that will search each users group membership, then create
a DFS Root for each user with DFS links to directories that the users Group
has Permmisions to.
For Example jim is a member of printing so the script would create a share
Jim, then create a DFS root Jim, and a DFS link under Root Jim to
\\server\Printing.
I thought to use an exel speadsheet that would have the Groups name and the
corresponding Folder to use as the DFS target.
I have been able to find a few scripts to try to piece together but I
thought that someone out there has either done this or wants to try.
Thanks. Tag: user account status Tag: 174040
OpenDSObject - Why can't I connect to remote user object?
OpenDSObject - Why can't I connect to remote user object?
I am trying to use OpenDsObject to connect to a user object, then
change the password.
It works if the user object is in the same domain as my desktop logon,
but not otherwise.
This is the heart of the code. Any tips or tricks on using
OpenDSObject for remote domains greatly appreciated!
'***** SAMPLE CODE *****
sTarget = "LDAP://cn=Sample User,ou=Test,dc=domain,dc=com"
sUsername = "sampleuser"
sPassword = "XXXX"
ADS_USE_ENCRYPTION = 2
Set oLDAP = GetObject("LDAP:")
Set oAdObject = oLDAP.OpenDSObject(sTarget, sUsername, sPassword,
ADS_USE_ENCRYPTION)
oAdObject.ChangePassword sPassword, sNewPassword
'***** END SAMPLE CODE ***** Tag: user account status Tag: 174037
Vbscript.pdb
Could someone tell me how to get hold of the latest version of the
public symbols for vbscript?
Thanks Tag: user account status Tag: 174034
Vbscript.pdb
Could sometime tell me how to get hold of the latest version of the
public symbols for vbscript?
Thanks Tag: user account status Tag: 174033
removing wins
Can anyone tell me how to write a script to remove the wins settings on
my networked pc's. thanks Andy Tag: user account status Tag: 174031
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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status Tag: 173980
Script to uninstall software
Hello,
Please post a script how to uninstall software from computer. Software is
McAfee Antivirus
Thanks Tag: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status 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: user account status Tag: 173920
Hello,
In windows 2000 or xp, how do you determine if a user is admin or power
user or normal user.