Sound Recording with VBScript
Hi there,
does anybody know how i can record sound within vbscript?
Many thanks to you.
Ulrich Tag: Exchange Name Tag: 171467
Wscript.Echo error in VBS Embeded in HTML
Hi All:
I have a script that I am writing that is basicly an HTML file with embeded
VBS Coding. I am basicly designing the script so that it uses a small
browser to open and have the user input an User ID & Server name (Via Text
Input boxes) and when the click the submitt button the script goes off and
verifies that a user folder is not on a share, and then creates it, shares
it, permissions and reports to a log any errors. Now here is my problem.
All of my VBS code is located in one big sub routine that is called when the
user clicks the button in the browser. Now any time that I try to access
anything with Wscript (Wscript.sleep or Wscript.echo) If give me an error
stating "Object Required: Wscript". Any suggestions on how to avoid this so
that I can use the wscript object. Thanks
Lost Tag: Exchange Name Tag: 171442
Reading and displaying records from a table in a database with vbscript?
Okay I have a script straight from the windows 2000 scripting guide
that shows me how to connect to a database. This I have done. What
I'm trying to do is connect to an access dbase and read a tables
contents and display each record, or at least assign them to variables
in vbs so that I can use them to create accounts.
So far I have this.
*********************************************************************
const adopenstatic=3
Const adlockoptimistic=3
Const aduseclient=3
Set objConnection=CreateObject("ADODB.Connection")
Set objRecordset=CreateObject("ADODB.Recordset")
objConnection.Open "DSN=testdb;"
objRecordset.Cursorlocation=aduseclient
objRecordset.Open "SELECT * FROM main" , objConnection, adopenstatic,
adlockoptimistic
wscript.Echo objrecordset.recordcount
objrecordset.close
objconnection.close
************************************************************************
I have been all over the web looking for info about this but I must be
searching on the wrong things. Can someone help me out or at least
point me in the right direction?
Thanks
Jason Tag: Exchange Name Tag: 171434
Multiple Column Lookup - Dictionary Object?
Hello.
I'm trying to come up with a solution for a lookup which contains
multiple columns. I read somewhere (can't find the article/solution)
that a dictionary can contain an array. I was trying the following
code but receive the following error: "Subscript out of range"
'myarray'". Any help is appreciated. Also if anyone knows an easier
way...
----------------------------------------------------
Dim objDict
Set objDict = CreateObject("Scripting.Dictionary")
ReDim myarray(2)
objDict.add "cat", myarray("a", "b", "c")
objDict.add "dog", myarray("d", "e", "f")
objDict.add "pig", myarray("g", "h", "i")
----------------------------------------------------
Thanks in advance,
-Jim Tag: Exchange Name Tag: 171432
URL limit exceeded
Hello!
I have exceeded the length of the URL limit. I have a form where I send data
using GET method. Now I have to change method of posting data into POST
method. But please tell me how to get data after passing them, because when
I call
request.querystring("field1")
it doesn`t work in the post method.
Please help, I will be grateful for help
Marcin from Poland Tag: Exchange Name Tag: 171426
Error Checking in Logon Scripts
I am not new to scripting but I am new to logon scripts. As a rule just how
verbose should I let my logon scripts get? Currently I am doing most
everything in vbs and a couple are .wsf. I am doing eror trapping and
logging, (event logs, logging) now, is there a point where it becomes counter
productive?
Also is there a general preference for logon and GP scripts vbs or wsf? Tag: Exchange Name Tag: 171422
.vbs vbscript query a sql server database
Hi,
I need to query a database and get one field out "ie full name". Its a sql
server 7.0 (I also have the database housed in an 8.0 (2000) database)
Can anyone help with code examples. How to make a connection to a database
from a vbscript.
Thanks. Tag: Exchange Name Tag: 171420
search engine safe urls
Hey,
Anyone seen a good solution for Search Engine Safe URLs with Classic
ASP? I've been looking for a while and short of using the 404 or
installing tool on the server (for URL rewriting) I was hoping there
might be something else.
In ColdFusion you can do a http://server.com/myfile.cfm/id/410 and it
just works ...
Thanks,
:rob Tag: Exchange Name Tag: 171412
Log file size tempoary event cosumer.
Hello,
Independent of the log file properties (things like specifying log file
size, overwrite events, etc.) I'd like to create a temporary event
consumer with vbscript to monitor log file size and send a message box
to the user notifying them a given log is filling up.
I searched Microsoft's website looking for event ID's related to
EventLog. The only event ID I found for which I would monitor is 6000,
The %1 log file is full.
While this is a good start, I'd like to notify the user BEFORE the log
gets too big... To me this is kinda like the oil pressure light in a
car. As a warning light, that light is mostly useless because if it
goes off for a real reason, chances are engine damage has already
occurred.
I looked in the Performance monitor for a counter object related to log
file size and could find anything either.
At any rate, does anyone know if a percentage of log file size can be
actively monitored?
Thanks!!! Tag: Exchange Name Tag: 171408
Re: Aaagh! cScript no longer Returning! ??
Sorry, Just again : as you can see, forcing cscript instead of wscript
does not have any effect:--
----------------------------------------
C:\> cscript.exe //H:CScript C:\inetpub\AdminScripts\mkwebdir.vbs -c
localhost -
w "Default Web Site" -v "adminDir","C:\MyDir"
Microsoft (R) Windows Script Host Version 5.1 for Windows
Copyright (C) Microsoft Corporation 1996-1999. All rights reserved.
3/10/2005 3:46:16 PM : Accessing root for IIS://localhost/W3svc/1
3/10/2005 3:46:16 PM : Done.
---------------------------------------------
Thanks! Tag: Exchange Name Tag: 171402
Re: Aaagh! cScript no longer Returning! ??
Sorry, Just again : as you can see, forcing cscript instead of wscript
does not have any effect:--
----------------------------------------
C:\> cscript.exe //H:CScript C:\inetpub\AdminScripts\mkwebdir.vbs -c
localhost -
w "Default Web Site" -v "adminDir","C:\MyDir"
Microsoft (R) Windows Script Host Version 5.1 for Windows
Copyright (C) Microsoft Corporation 1996-1999. All rights reserved.
3/10/2005 3:46:16 PM : Accessing root for IIS://localhost/W3svc/1
3/10/2005 3:46:16 PM : Done.
---------------------------------------------
Thanks! Tag: Exchange Name Tag: 171400
Re: Aaagh! cScript no longer Returning! ??
Hi Frank,
This does not make any difference. Its very odd. It seems to be XP
machines that cause this to hang. The weird thing is that it used to
work a treat, and for some reason since the begining of this year it
has never ever returned!
I was redirecting to a file in terms of
cscript.exe <cmdpath> <options> >>c:\install.txt and I thought perhaps
it was a write protected c:\ issue. so I removed that.
Here's what I am doing - this is straight from a cmd.exe prompt:
Interesting: if you look, the first time I tried it I miss-spelled the
.vbs script, and cscript did actually return OK. The next time I typed
the correct .vbs file, and it never returned;
----------
C:\>cscript.exe C:\inetpub\AdminScripts\mkwebd-ir.vbs -c localhost -w
"Default Web Site" -v "adminDir","C:\MyDir"
Microsoft (R) Windows Script Host Version 5.1 for Windows
Copyright (C) Microsoft Corporation 1996-1999. All rights reserved.
Input Error: Can not find script file
"C:\inetpub\AdminScripts\mkwebd-ir.vbs".
C:\>
C:\>cscript.exe C:\inetpub\AdminScripts\mkwebdir.vbs -c localhost -w
"Default Web Site" -v "adminDir","C:\MyDir"
Microsoft (R) Windows Script Host Version 5.1 for Windows
Copyright (C) Microsoft Corporation 1996-1999. All rights reserved.
3/10/2005 3:37:40 PM : Accessing root for IIS://localhost/W3svc/1
3/10/2005 3:37:40 PM : Done.
----------
here you see that the c:\> prompt never comes back. Have Msoft changed
their vbs files recently or for XP ???
Please Help! Tag: Exchange Name Tag: 171399
Runtime Error
Hi!
I use the following lines to open a window in IE and insert the text
"Invoice no." into Sp1 (an OWC Spreadsheet component imbedded in KFAKT.htm):
Dim wnd
Set wnd = window.open("KFAKT.htm", "")
wnd.Sp1.Range("B10").Value = "Invoice no."
Most of the time the code works but sometimes I get an error message -
"Object doesn't support this propery or method: 'wnd.Sp1'".
Any ideas?
Regards
PO Tag: Exchange Name Tag: 171397
Set windows file permissions
Hi All
I have recently changed to a windows 2003 web server and I previously used
the ADsSecurity object to set folder permissions on webs that were created
using vbscript. Now, I get a cannot create object error and I assume this is
because the ADsSecurity.dll does not exist on windows server 2003.
I was wandering if I should register this dll with 2003 and if my code
should then work or if there is a new way of doing things with windows
server 2003.
Any advice would be truly welcomed.
Thanx in advance
Joe Tag: Exchange Name Tag: 171391
Copy and install
I need to copy a folder from the network with a program in it. After it has
been copyed to the C: it must run the setup file. I can copy it, but cant
find the right command to get it to run. Here is my script:
------------------
Set fs = CreateObject ("Scripting.FileSystemObject")
fs.CopyFolder "\\Ask\Programmer\NetscreenKlient", "C:\NetscreenKlient"
ws.Run ("C:\NetscreenKlient\Setup\setup.exe")
------------------
The ws.Run command is where the error is. What should i use instead. Or do
anyone have another way to do this.
Best regards
Jesper
Denmark Tag: Exchange Name Tag: 171389
Tag Base
Dear All,
i have used the tag base in the head of my page ; <base
href="http://yazeed/123/" /> . and my apllication is on "http://Default/"
all the images and swf files worked properly , but the problem is that i
have a javasript method "window.open(mypage.html)" but it didn't take the
effect of the base ; the page opened is "http://Default/mypage.html" instead
of "http://yazeed/123/mypage.html" .
Anyone can help ????
--
Yazeed
.net Developer(c#)
--
Yazeed
.net Developer(c#) Tag: Exchange Name Tag: 171387
2 dimensional array
Please can anyone help me!!
I want to read the contents of a text file into a 2 dimensional array.
Each line will have 6 colums of data separated by a comma.
So far I,ve got ............
Do Until objTextFile.AtEndofStream
strNextLine = objTextFile.Readline
MyArray = Split(strNextLine , ",")
Loop
..but this is just a 1 dim array ....any pointers
thanks in advance
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: Exchange Name Tag: 171386
Export/Import Registry Across Machines
Hello --
I have 5 serves at work that I need to duplicate registry setting on an
ongoing basis. Essentially, server 1 will be my master server where my
application makes all its changes. I would then like to run a script from
server1 that exports the registry and automatically connects and imports the
registry on server2, 3, 4, and 5.
How can I connect to remote servers from a different server via registry and
using .RegRead and .RegWrite from WSH or VB6?
Any help or insight would be appreciated. Tag: Exchange Name Tag: 171385
HELP!!!!!!!!!!
I'm pulling my hair out here.
I have an ASP page which causes an error when loading.
The error is...
***************************
Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method
/intranet/default.asp, line 66
***************************
The procedure causing the problem in the default.asp page is
******************************************
Sub GetEvents()
Dim oApp, clsD, vCls, clsE
Dim sEvents
Set oApp = Server.CreateObject("Calendar.clsApplication")
Set vCls = oApp.GetCalendarMonth(Year(Date()), Month(Date()), vbMonday)
For Each clsD In vCls
If clsD.TodaysDate = Date Then
If clsD.DoesDayHaveEvents Then
For Each clsE In clsD
%>
<li><a
href="EventDefault.asp?app=Calendar%20Events"><%=clsE.Title%></a></li>
<%
Next
End If
End If
Next
'we will always have the last link
%>
<li><a href="EventDefault.asp?app=Calendar%20Events">Click here to view
the calendar</a></li>
<%
Set clsD = Nothing
Set vCls = Nothing
Set oApp = Nothing
End Sub
******************************************
The actual error line (Line 66) is the line that says:-
For Each clsD In vCls
This code actually works on our intranet and another developers machine, but
does not work on my system (the main development machine) when I run
//localhost/intranet/default.asp.
When I comment out this routine, it does run.
Does anyone have any ideas?
Thx Tag: Exchange Name Tag: 171382
Pass a Parameter from VB Script to Crystal
All,
I can't make my VB Script pass a parameter to Crystal.
Have tried many different variations, per my commented out lines, but none work.
Could some kind person please let me know what I am missing ...?
Option Explicit
On Error Resume Next
Dim objCRApplication, objCRReport, objCRDatabaseTable
Set objCRApplication = CreateObject("CrystalRuntime.Application")
Set objCRReport = objCRApplication.OpenReport(myReport, 1)
'------------------------------------------------------------------
'HERE IS MY PROBLEM ....I WANT TO PASS A VALUE OF '123' TO CRYSTAL
'------------------------------------------------------------------
'objCRReport.ParameterFields.Item(1).SetCurrentValue "123"
'objCRReport.ParameterFields(0).AddCurrentValue("123")
'Dim strMyParmValue
'strMyParmValue = "123"
'objCRReport.SetParameterValue("Parameter1", strMyParmValue)
'------------------------------------------------------------------
' END
'------------------------------------------------------------------
With objCRReport.ExportOptions
.FormatType = 31
.DestinationType = 1
.DiskFileName = myOutputFile
End With
For Each objCRDatabaseTable in objCRReport.Database.Tables
objCRDatabaseTable.ConnectionProperties("user id") = "user"
objCRDatabaseTable.ConnectionProperties("Password") = "password"
Next
objCRReport.DiscardSavedData
objCRReport.Export(False)
Set objCRReport = Nothing
Set objCRApplication = Nothing
Set objCRDatabaseTable = Nothing Tag: Exchange Name Tag: 171378
get proxyaddresses for all contacts of an OU using vbs & ADO
Hello,
I'm making a script to compare an export of an OU(csv)
with the content of an OU. I saw approaches using ado or
ldap. But using ADO i'm only able to connect to Rootdse
and get the proxyaddresses attribute of all users. How
can i filter down to the OU and afterwards get the
contacts or user's proxyaddresses from that specific OU
only?
thanks Tag: Exchange Name Tag: 171375
Blocking right mouse click to copy items on html internet page
Dear,
because I want to use some material on the internet site, but I plan to
write a book too later,
I would like to "secure" (a little) my data on my html pages,
by giving a messagebox when the visitor gives a right mouse button click.
I want to remove the copy menu and give a message such as "sorry, this
material is copyrighted"...
Any good idea's please ?
Phil
webmaster Official site
101st Airborne
463rd Parachute Field Artillery
--
http://users.skynet.be/101airborne Tag: Exchange Name Tag: 171374
xml /text-file issue
Hi,
I create an XML-file with a vb-script containing an AS
database. This file I load in the Analysis Services
dso/xml console.
I create my file with VbS:
Set objFSObject = CreateObject
("Scripting.FileSystemObject")
Set objFile = objFSObject.CreateTextFile("dso.xml", 8,
True)
This works great as long as I copy all the content of my
textfile into and replace all the content of a generated
file from DSO/XML convertion utility. But if I try to use
my file direct with the dso/xml console nothing happens.
If start "my" XML-file with IE there is an errormessage
and no text shows up, but if I replace the content of a
generated file it shows up in a coorect and structured
way.
Is there different types of xml-files ? I thought that
any text-file named .xml would work.
/Jerome Tag: Exchange Name Tag: 171373
Changing the name of MSI installed software
I was wondering if anyone would know if it is possible to change the name of
software in the Add/Remove software list.
I have tried using
set obj.Name = "Change the name"
and
set obj.Caption = "Change the name"
I have a feeling that this is not scriptable.
Thanks Tag: Exchange Name Tag: 171369
How to Search C:\ to find a file
Hi,
I have found several scripts that will search for files as long as a
folder name is provided as soon as I change it to C:\ I get permission
errors. As I don't know where the file will be I need to search from
C:\. Can vbscript do this? Tag: Exchange Name Tag: 171363
Finding out when desktop is available
I need to destermine within my vbs script when it is safe to start a function
within my login script. It is only safe for me to do that once the users has
entered his password and the "desktop" has appeared. If teh function that I
have runs before the desktop has appeared it fails.
I thought I could check to cul dstart my function once the explorer.exe
process is running but that appears to be running before the desktop is up.
What process or other identifier can I use to check so I can know it is safe
to start my process in teh script ? Placing it in the start, rograms
..startup folde ris not an option for me.
Thanks Tag: Exchange Name Tag: 171358
Problem with a class
I have created a class cReqPos in a file by itself
I include the class file in a page that creates an instance of the class and
do some stuff.
That instance is in a Session variable: Session("ReqPos")= new cReqPos
I submit that page to itself in several ocassions and the instance works
fine, but when I submit it to a different page and try to access its
properties, it fails: "Object doesn't accept that property or method".
What am I doing wrong?
Session("ReqPos") is still an object after submission, but somehow it loses
the properties and methods.
Thanks in advance Tag: Exchange Name Tag: 171350
Customizing Word 2003 menubar
I want to customize Word menubar from a macro. I would like to remove
options like "Save As", "Open", etc...
This because I will invoke Word from another application with the name of
the file. I want the users to change the opened document and save it, with
no other way of saving it somewhere else...
Thanks
Jacques Tag: Exchange Name Tag: 171348
Script to see if a user is logged in via RDP
I have a script that will tell you if a user is physically logged into a
workstation, but if the user RDPs and logs onto the workstation it appears
no one is logged in. Is there a way to tell via a script if someone is
logged in via RDP to an XP workstation. Here is my script that works for a
physical log in.
On Error Resume Next
Dim name
Dim User(20)
Dim wks(20)
Dim comname(20)
Dim strComputer(20)
y = 0
For x = 1 to 9
if y < 9 then
name = "computername-0"
else
name = "computername-"
end if
y = y + 1
comname(x) = name & y
Strcomputer(x) = comname(x)
Set objWMIService = GetObject("winmgmts:\\" & strComputer(x) &
"\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_ComputerSystem",,48)
For Each objItem in colItems
wks(x) = objItem.Name
user(x) = objItem.UserName
Next
Next
For r = 1 to 9
if user(r) <> vbempty then
Wscript.Echo wks(r) & " is currently in use by " & user(r)
else
Wscript.Echo wks(r) & " is available for RDP"
end if
Next Tag: Exchange Name Tag: 171345
How to determine server role
Hello,
I have many servers in a win2003 domain. I would like to have a ADSI
vbscript to determine the system role:
like, Domain Controller, member server, further more WINS, DNS, DHCP roles
even better.
Thanks,
Wensi Tag: Exchange Name Tag: 171344
Display a picture in VBScript.
Is it possible to display a picture with VBScript? I need a
stand-alone script to run when users log onto a network of Windows
2000 clients. I want to display a picture of our usage policy which
is longer than the Windows logon banner allows. Any help you can give
is greatly appreciated. Tag: Exchange Name Tag: 171343
Send email when password expires
I have found the following code at the scripting centre but contine to get
the following error when I try it:
Line 12 char1 table does not exist. Can someone please help me with this?
Set oConfig = CreateObject("CDO.Configuration")
Set colFlds = oConfig.Fields
colFlds("http://schemas.microsoft.com/cdo/configuration/sendusingmethod") =
2 ' cdoSendUsingPort
colFlds("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"server ip address"
colFlds("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") =
2 ' cdoNTLM
colFlds.Update
Set cnAD = CreateObject("ADODB.Connection")
cnAD.Open "Provider=ADsDSOObject;"
Set cmdLDAP = CreateObject("ADODB.Command")
cmdLDAP.ActiveConnection = cnAD
cmdLDAP.CommandText = "<LDAP://dc=netbios domain
name>;(objectCategory=User);samAccountName,mail,userAccountControl;subtree"
Set rsUsers = cmdLDAP.Execute
Do While Not rsUsers.EOF
sEmail = rsUsers("mail")
If Len(sEmail) = 0 Then
' User has no email address, so no point in checking further
Else
If rsUsers("userAccountControl") And &h10000 Then '
ADS_UF_DONT_EXPIRE_PASSWD
' User is exempt from password expiration
Else
sUser = rsUsers("samAccountName")
If Not IsNull(sUser) Then
Set oUser = GetObject("WinNT://domain name/" & sUser &
",user")
If oUser.UserFlags And 2 Then
' Account is disabled, so it doesn't matter
Else
iDaysLeft = (oUser.Get("MaxPasswordAge") -
oUser.Get("PasswordAge")) \ 86400
If iDaysLeft < 14 Then
Set oMsg = CreateObject("CDO.Message")
Set oMsg.Configuration = oConfig
oMsg.From = "mailadmin@ablao.ab.ca"
oMsg.To = sEmail
oMsg.Subject = "Password Expiration Warning"
oMsg.TextBody = "Your password expires in " &
iDaysLeft & " days."
oMsg.Send
End If
End If
End If
End If
End If
rsUsers.MoveNext
Loop
rsUsers.Close
cnAD.Close Tag: Exchange Name Tag: 171342
Passing object between Scripts
I would like to use an object in one script called from another script. The
object is created in the calling script. Based on the documentation in the
MSDN library, it appears I can only pass text.
Thanks,
dra Tag: Exchange Name Tag: 171339
"Assistant" Email Contact Attribute
Hello,
I am trying to populate the "Assistant" attribute field in email contacts. I
have not been able to find a way to do this. Does anyone know how I would
change this value using VBScript?
TIA,
Bill Burke
bill@2burkes.com Tag: Exchange Name Tag: 171337
Date Questions
I'm a programming neophyte so needless to say I need some help on some VB
scripting.
I need to create some code to find what month it will be this coming
Saturday. I also need to do the same for the week # of the month this
Saturday. And finally, the Year of the month this Saturday.
I just want the that paticular value returned (i.e. if I'm looking for the
month then it gives me 03 not 03/08/2005)
Could someone help me with this?
And Finally, is there a way to say that if the month is January (from the
value in the previous questons) the substitue January for A; Februray for B;
March for C; etc???
Thanks for the the help!?!?!?!
-vbDazed&Confused Tag: Exchange Name Tag: 171335
Error Reporting Strategies for Scheduled Scripts
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
--5009574-13942-1110386155=:1888
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE
I've got several scripts that I run on our server. Most move sql data=20
around from one source to another. Some just copy files. Anyway, I=20
haven't came up with a good error reporting strategy yet and I was=20
wondering how you all are handling it.
A good error handling strategy would
* log all errors to a text file
* time the script out after it ran for an hour or so
* report time outs to a log file
* just report errors that stopped execution
What else? How do you do it?
=F8=A4=B0`=B0=A4=F8,=B8_=B8,=F8=A4=B0`=B0=A4=F8,=B8_=B8,=F8
--5009574-13942-1110386155=:1888-- Tag: Exchange Name Tag: 171332
One window opened
Hello all again!
On the main form I have a few fields and among of them there is button which
opens additional window (named "Links") where user can delete and add data.
I want this user let open (from the main form) only one subform "Links". I
hope you know what I mean. An example of my idea is Winamp program, which in
the default version opens only once and
when somebody wants to open two Winamp programs in the same time it is
rather impossible or settings change is then needed. I do not even know in
what language it is possible to do, maybe in javascript.
Thank you in advance for your posts
Best and kind regards
Marcin from Poland Tag: Exchange Name Tag: 171330
browse window
Hello!
I would like to use such a browse window, thanks for it, I would
select/choose a path of the local source files, which paths would be saved
in the database. Is it possible in VBScript if so, please be so kind and
give me a code. After saving I would like to create a button in VBScript and
HTML which would open me this file in the default program installed on the
local machine.
Hard question, so I will be grateful for any posts.
Kind regards
Marcin Tag: Exchange Name Tag: 171329
wscript.quit 8004005 Error
I have a WSF script that we use with SMS to install software. The script
calls the cmd line for an installation (setup.exe, MsiExec.exe, etc.) I am
using the following line to call the install:
strRunTime = oshell.run(strCMD,1,1)
WScript.Quit(strRunTime)
strRunTime captures the return value from the setup and passes it to
wscript.quit so that SMS will know whether the install was successful.
Here's the issue this code is working on literally 1000s of machines;
however, there are 2 that will process the script trhough the strRunTime line
and then throw the unspecified 80004005 error from source null. Oddly, the
line number that is throws with the error is part of a second portion of
embedded code in the wsf. a snipet of the code is below. The line number in
the error is referencing the line after <![CDATA[.
Any thoughts?
Select Case strReady
Case 1
strRunTime = oShell.run(strCMD,1,1)
WScript.Quit(strRunTime) 'Using Wscript.Quit to pass any error codes from
the package
'back to the application that called the script (e.g. SMS)
Case 5
strRunTime = oShell.run(strCMD,1,1)
WScript.Quit(strRunTime) 'Using Wscript.Quit to pass any error codes from
the package
'back to the application that called the script (e.g. SMS)
Case 6
strRunTime = oshell.run(strCMD,1,1)
WScript.Quit(strRunTime) 'Using Wscript.Quit to pass any error codes from
the package
'back to the application that called the script (e.g. SMS)
Case 7
If strHelpSite = Empty Then
strLater = MsgBox("You have selected to not install " & strPkgName & "."
& VbCrLf &_
"You will be prompted again in 24 hours to run" &VbCrLf &_
"the installation. If you prefer you can install"
&VbCrLf &_
"the application manually as follows:" &VbCrLf &VbCrLf &_
"1. Click Start" &VbCrLf &_
"2. Click Control Panel" &VbCrLf &_
"3. Click Add/Remove Programs" & VbCrLf &_
"4. Repeat Step 3 If necessary" & VbCrLf &_
"5. Click Add New Programs" & VbCrLf &_
"6. Click " & strSMSPkgName & VbCrLf &_
"7. Click Add, you will be prompted with the previous
dialog" &VbCrLf &_
"",vbOKOnly,strPkgName &" Install")
Elseif strHelpSite <> Empty Then
strLater = MsgBox("You have selected to not install " & strPkgName & "."
& VbCrLf &_
"You will be prompted again in 24 hours to run" &VbCrLf &_
"the installation. If you prefer you can install"
&VbCrLf &_
"the application manually as follows:" &VbCrLf &VbCrLf &_
"1. Click Start" &VbCrLf &_
"2. Click Control Panel" &VbCrLf &_
"3. Click Add/Remove Programs" & VbCrLf &_
"4. Repeat Step 3 If necessary" & VbCrLf &_
"5. Click Add New Programs" & VbCrLf &_
"6. Click " & strSMSPkgName & VbCrLf &_
"7. Click Add, you will be prompted with the previous
dialog" &VbCrLf &VbCrLf&_
"Click yes for a printable version of the
instructions",vbYesNo,strPkgName &" Install")
Select Case strLater
Case 6
strRunHelp = oshell.run(strHelpSite,1,0)
Case 7
WScript.Quit()
End Select
End If
End Select
End If
]]>
</script>
<script id="pkgPromptConfig" language="VBScript">
<![CDATA[
If strConfig = 1 Then
Const FORReading = 1
Const ForWriting = 2
'WScript.Echo("Configure Script")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("pkgPromptVar.vbs", ForReading)
n = 0
reDim aryVars(n)
Do Until objTextFile.AtEndOfStream
strFileInput = objTextFile.Readline
If strFileInput <> Empty Then
aryVars(n) = strFileInput
n = n + 1
ReDim Preserve aryVars(n)
End If
Loop
ReDim preserve aryVars(n - 1)
objTextFile.close
Set objTextFile = objFSO.OpenTextFile("pkgPromptVar.vbs", FORWriting)
For Each strLine In aryVars
aryInp = split(strLine,"=")
aryInp1 = Split(aryInp(1),"'")
'WScript.echo("Before: " & aryInp(0) & "=" & aryInp1(0) & "'"& aryInp1(1))
strCfgParm = InputBox(aryInp1(1),"Script Configurator",aryInp1(0))
'WScript.echo("After: " & aryInp(0) & "=" & strCfgParm & "'"& aryInp1(1))
objTextFile.WriteLine(aryInp(0) & "=" & strCfgParm & "'"& aryInp1(1))
Next
End If
]]>
</script>
</job>
</package> Tag: Exchange Name Tag: 171324
Net Send or an alternative
Hi,
I have used Net Send to communicate with other machines on my LAN but have
trouble with it on some new XP SP2 machines. I've started the Messenger
Service but seem to be missing something. It works with some machines but
not all. What am I missing. It's not a firewall issue. I had no problems
with my old Win2K machines.
Are there alternatives to the Net Send to sent a pop-up message to others?
thanks,
Mike Tag: Exchange Name Tag: 171322
Performance difference
I have this big VBscript where the author has used functions instead
of subroutines when there is no need for functions.
Is there any difference in performance using subroutines versus
functions in VBscript. Tag: Exchange Name Tag: 171321
Need to run cacls from ASP
Hi
I'm working on a create user script, and need to give user Full Controll
of his/hers home directory. A Web Application will be doing a
HTTP-request to an ASP, which then will run the create user script. I
have already set myself, an admin user, in the Anonymous Access in the
Directory Security for the web site. I did this cause no script would
run, and interactiv logon is not an option since its a web application
which will be making the request. But cacls wouldn't do anything anyway.
This is how I called cacls:
set obj = Server.createObject ("wScript.shell")
Call obj.Run("cacls " & USER_ROOT_UNC & "\" & un & " /e /g " & un &
":F", HIDE_WINDOW, WAIT_ON_RETURN )
The ASP ran to the end, but when i checked the ACL of the directory, the
user wasn't included, and the cacls command hadn't done a thing. I got a
tip from a friend, and installed dynu.dll and used that exec method.
Then it returned: Access Denied.
rsCmd = "cacls " & USER_ROOT_UNC & "\" & un & " /e /g " & un & ":F"
Set myexec = Server.Createobject("Dynu.Exec")
Response.Write(myexec.execute( rsCmd ))
Is there a way to authenticate an admin user, so I can remove my admin
user from Anonymous Access and/or run the script?
Geir Roger Moen Tag: Exchange Name Tag: 171315
.ini file to read script values
Hi,
I have created a few scripts for monitoring purposes that
need input like hostname, logfile path name, etc. Instead
of hardcoding all values into each script I thought about
using a .ini file to hold the values which in turn can be
read by my scripts. I.E:
********** start .ini file **********
[hostname]
myserver1
[logfile path]
C:\folder\logfiles
********** end .ini file **********
The scripts use the following code to read the .ini file:
********** script example **********
Set objFSO = CreateObject("Scripting.FileSystemObject")
strINIfile = "C:\folder\file.ini"
' Open INI file to retrieve string values
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(strINIfile,
OPEN_FILE_FOR_READING)
Do Until objTextFile.AtEndOfStream
strText = objTextFile.ReadLine
If Instr(strText, "[hostname]") Then
strLogPath = objTextFile.ReadLine
End If
If Instr(strText, "[logfile path]") Then
strSchemaPath = objTextFile.Readline
Exit Do
End If
Loop
objTextFile.Close
Set objTextFile = Nothing
Set objFSO = Nothing
********** end script example **********
This all works very nice, but to me it looks like a little
bit of spaghetti-programming; does anyone know a nicer
(more professional) way of achieving the same result?
TIA,
Wouter Tag: Exchange Name Tag: 171310
Call Function in ASP
Hi, I'm getting an "HTTP 404 error file not found" when I click on the
Continue button. I think my ocde is incorrect somewhere in the IF block.
Is anyone able to see where the error is with my code below?
<% IF Session("UserLogonID")= "" THEN Response.Redirect "../Timeout.asp"%>
<!-- #include file="../CommonInclude/FunctionsHTML.asp" -->
<!-- #include file="Include/DisplayProjects.asp" -->
<%
ProjectID = Request.QueryString("PROJ")
ClosingProject = Request.QueryString("ClosingProject")
If Not IsEmpty(Request.Form("_continue")) Then
'This block gets called when the Continue (submit) button is clicked on
' The function call may not be the correct syntax, I haven't tested it
CloseProject()
End If
Call DisplayProject (ProjectID)
%>
<%If ClosingProject = "Yes" Then %>
<FORM method=POST id=form1 name=form1>
<TABLE BORDER=0>
<TR></TR><TR></TR><TR></TR>
<TR><TD><%=CancelButton%><input id="_continue" type="submit"
value="Continue"></input></TD></TR>
</FORM>
<%End If %>
<% Function CancelButton%>
<INPUT type="button" value="Cancel" id=Cancel name=Cancel
onclick="window.location='../WelcomeDataMaintenanceReDirect.asp';"
style="WIDTH: 80px; HEIGHT: 22px; font-size: 10px bold; COLOR:#FFFFFF;
BACKGROUND:#6699FF;">
<% End Function%>
<% Function CloseProject()%>
<%
' Close project, and update audit trail.
dim COM_General
dim COM_GroupMaintenance
dim COM_AuditTrail
dim COM_DemandFrontEnd
dim objConn
dim objConnAuditTrail
ProjectID = Request.Form ("ProjectID")
set COM_General = Server.CreateObject ("eOffice.General")
set COM_GroupMaintenance = Server.CreateObject ("eOffice.GroupMaintenance")
set COM_AuditTrail = Server.CreateObject ("eOffice.AuditTrail")
set COM_DemandFrontEnd = Server.CreateObject ("eOffice.DemandFrontEnd")
set objConn = COM_General.OpenConnection (Application("APPConnectionString"))
set objConnAuditTrail = COM_General.OpenConnection
(Application("AUDITConnectionString"))
StatusUpdate = COM_DemandFrontEnd.CloseProject(objConn, ProjectID)
CALL COM_General.closeConnection (objConn)
CALL COM_General.closeConnection (objConnAuditTrail)
set ObjConn = Nothing
set objConnAuditTrail = Nothing
set objRST = Nothing
set COM_General = Nothing
set COM_GroupMaintenance = Nothing
set COM_DemandFrontEnd = Nothing
set COM_AuditTrail = Nothing
Response.Redirect "DisplayProjects.ASP?PROJ=" & ProjectID &
"&ClosingProject=Yes&ProjectClosed=Yes"
%>
<% End Function %>
Thanks for your help. Tag: Exchange Name Tag: 171297
Advice/thoughts on best way to search registry?
Hi all,
I'm looking for opinions on the best way to search a branch of the =
registry. I'll be looking for specific string data in the subkeys of:
HKCU\Software\Microsoft\Windows\ShellNoRoam\Bags
The data occurs in a value which is in some but not all of the subkeys =
(FolderType). When found, I'll want to determine which key(s) contained =
the data.
I found this:
http://groups-beta.google.com/group/microsoft.public.scripting.vbscript/m=
sg/f25e5d6e077e37e5
which seems to indicate that exporting, using findstr and string =
manipulation might be the most efficient way to go for this portion of =
my project.
Thoughts? Suggestions? Opinions?
Thank you,
Keith Tag: Exchange Name Tag: 171295
HOWTO: Use DotNet Created DLL in VBScript
Can I create a DLL in Visual Studio .Net 2003 using VB.NET as the
programming language and call it from a VBScript program using
Server.CreateObject? Is there any example code?
I want to use the .Net sockets functionality, via System.Network.Sockets to
replace the unstable Winsock control. I need to handle TCP sockets
communication between two computers in a vbscript file because I only have
the capability of loading vbscript macros into another software product I
purchased.
Currently, I have a vbscript file that does a
Server.CreateObject("MSWinsockConstant","MSWinsock") and connects to a TCP
server that sends it data, but there are issues when disconnecting. I need
to upgrade this to a more stable solution.
--
Thank you kindly,
Dan Sikorsky MSCS, BSCE, BAB Tag: Exchange Name Tag: 171292
Frequent Error
I am using T Lavedas' WSH Scripts for msgbox function. I get the following
error frequently:
"Could not create object named "InternetExplorer.Application""
Error number: 800004002
I also notice that it usually takes a more that 2 or 3 seconds for T
Lavedas' WSH Scripts msgbox to come up, once I start the script.
Thanks,
dra Tag: Exchange Name Tag: 171284