datatype mismatch error any ideas please
Hi.
Winxp/iis5/dwmx/asp/vb/msaccess
I'm trying to update a record based on a cookie existance.
I'm getting this error when trying to load the page
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria
expression.
/affiliates/set.asp, line 19
I've tripple checked the data types in the database and can't see anything
wrong.
The field is a simple hit counter and is set to number/long integer
The code for the hit counter is as follows
<%
IF Request.Querystring("Affid") <> "" THEN
Response.Cookies("Affidcookie") = Request.Querystring("Affid")
Response.Cookies("Affidcookie").Expires = Date + 30
END IF
%>
<%
if(request.querystring("affid") <> "") then Command1__varid =
request.querystring("affid")
IF NOT Request.Querystring("Affid") = "" THEN
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_conn222_STRING
Command1.CommandText = "UPDATE affiliates SET hits = hits + 1 WHERE Affid
= '" + Replace(Command1__varid, "'", "''") + "'"
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute() 'this is line 19
END IF
%>
Can anyone shed some light on this for me i'm stumped.
Dan Tag: Find Disabled accounts and then enable accounts Tag: 161739
Printing From ASP
Is it possible to print a web page dynamically using Vb Script? I have
several "reports" that are generated by my web site that I would like to
print all at once. I could do the looping myself, but how can an indiviudal
page be printed? Thanks for the help. Tag: Find Disabled accounts and then enable accounts Tag: 161736
Server permission problems and SchAgent
Hi All,
Using Win2k sp3
Perl 5.8.1
Apache2
I was using a CGI script in an Apache2/Win2k
network to browse files and filetime info
on the server and across the network. Using
the default account for Apache2, I succeeded
on the web server, but got bad file descriptors
when going across LAN. It was the usual permission
trouble.
Since I was using Perl CGI I ran over to CPAN
and looked for a module to do a CreateProcessWithLogon
or some such beast.
I couldn't get any of several modules to work.
Then I realized that the trusty Scheduler.SchAgent
might be the trick.=20
I ended up using a named pipe. The CGI script
fires a Pipe client (setup as a Scheduled Task) to read
the x-lan file, and write to the named pipe.=20
The info was read back from inside the CGI script=20
running a Pipe server.
The CGI script used the SchAgent object to Activate
the desired Scheduled Task, give it the right command
line, then "Run" it.=20
It works because the web server is running in the
SYSTEM account, and the fired Scheduled Task is running
as the Administrator. I setup the task before hand with
username and password I need, but when I "Run" from CGI
its not necessary to supply the credentials again :)
Here's a simple Perl demo
http://4.11.211.97/PLPipe.zip
regards,
tlviewer Tag: Find Disabled accounts and then enable accounts Tag: 161732
InternetExplorer.Application methods and properties reference
Where can I find more information about properties
and methods available on "InternetExplorer.Application" object? If I
want to use "InternetExplorer.Application" to the fullest, which book or
web reference would you suggest?
Another quick question: how to attach to *EXISTING*
(so the script does not create its own InternetExplorer.Application
object) instance of Internet Explorer and control it via script?
Drazen
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: Find Disabled accounts and then enable accounts Tag: 161731
Weird
The very weird thing is, in my testing, I added a line
"RAISERROR('Test',16,1) at the beginning of the stored procedure, and then
after the execution, the vbscripts catches the error. If I move the line
"RAISERROR.." to any place within the stored procedure after a sub-stored
procedure has been called, the vbscripts code could not catch the error.
Note that the error is caught by Query Analyzer fine, no matter where I put
the RAISERROR. Tag: Find Disabled accounts and then enable accounts Tag: 161726
Script in Environment varaible
How can I set several environment variables with a VB script. These will be
system Environment variables.
Thanks
Paul Tag: Find Disabled accounts and then enable accounts Tag: 161724
Any Way to Change Source name in Event Viewer
I'm using "WSHShell.LogEvent" and in the event viewer it says "WSH" as
the source. I was wondering if there is a way to change that title?
Preferable to the name of my script.
Thanks in advance,
Craig. Tag: Find Disabled accounts and then enable accounts Tag: 161720
Start services using Vbscript within MOM
Hello,
I like to start the services if they are stopped using MOM, any clue?
Could I alter the script that excist in mom to do that? Tag: Find Disabled accounts and then enable accounts Tag: 161719
How Do I Handle Specific Errors
I have a simple configuration section in which I set the array size,
and therefore want to be able to handle the error:Subscript out of
range:.
As I have "On Error Resume Next" set, which I require I want to be
able to capture this error and write it out to my logfile.
How do I do this?
Thanks in advance,
Craig. Tag: Find Disabled accounts and then enable accounts Tag: 161718
mass reset password
Hi
Is there a way to mass change passwords for all the users in an OU of the AD
with a scritp
I hava a .txt file with the username and new password
and I know the OU
Can you help me please?? Tag: Find Disabled accounts and then enable accounts Tag: 161713
Automatically scrolling IE window to show last lines added
I created a script which retrieves values from registry
keys on all networked (online) computers in our domain.
For that purpose some kind of progress indicator was needed.
This is the *example* how that was made:
---START---
Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.Navigate "about:blank"
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 800
objExplorer.Height = 600
objExplorer.Left = 0
objExplorer.Top = 0
Do While (objExplorer.Busy)
Wscript.Sleep 200
Loop
objExplorer.Visible = 1
objExplorer.Document.Body.InnerHTML = "Progress..."
Do While 1=1
objExplorer.Document.Body.InnerHTML =
objExplorer.Document.Body.InnerHTML & "<BR>" & "some text..."
Wscript.Sleep 300
Loop
Wscript.Quit
---END---
When this script is run, Internet Explorer is started and lines
with text "some text..." are added one under another.
When there is too much text to fit on the screen, vertical scrollbar
is automatically created and text is scrollable.
The question is how to modify the script so that when lines
of text are added to the bottom the window automatically scrolls
to show the last line added to log, without user having to scroll
manually to see the newest lines?
Drazen Tag: Find Disabled accounts and then enable accounts Tag: 161711
populating a list of available printers (client-side)
On the Internet, I found the following simple snippet of VB code that
creates a list of available printers:
strList = "The following printers are available: "
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set PrinterList = objWMIService.ExecQuery("Select Name from
Win32_Printer")
For Each Printer In PrinterList
strList = strList & Chr(13) & Trim(Printer.Name)
Next
MsgBox strList
It works fine under VB 6.0, but not as a client-side script running in
an ASP page under the browser (IE 6.0 in my case) - it fails at the
GetObject.
Is there are way to get this to work as client-side script (or is
there an alternative approach that will work and accomplish the same
goal?)
Any insight or solution would be much appreciated!! Thanks in advance
...
-- Trevor Feldman Tag: Find Disabled accounts and then enable accounts Tag: 161708
Extracting from Security Log
Hi Scripting Experts,
I'm trying to write a script to log Domain Logon Failures, rather than
trawling thru our DCs logs. For the moment I'm happy with getting
output, rather than just logging to a file.
So far I have is the following which outputs the number of Domain
Logon Failures as indicated by Event ID 675.
My question - how do I go about extracting the username and time the
event was logged? Scripomatic doesn't seem to mention this for the
Win32_NTLogEvent collection. Here's my script so far, help much
appreciated.
'VBScript to check the Security Log for Logon Faillures
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Security)}!\\" & _
strComputer & "\root\cimv2")
Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'Security' and " _
& "EventCode = '675'")
Wscript.Echo "Domain Logon Failures: " & colLoggedEvents.Count Tag: Find Disabled accounts and then enable accounts Tag: 161705
End running screensaver with vbscript?? Please Help
Is there a way to end a screensaver from a vbscript?
I have a vbscript scheduled to run at 9:00 pm via the windows task
scheduler. One of the first things i want the script to do is to kill the
running screensaver. How can i do this? I have tried using the
WshShell.SendKeys method to send keystrokes to the screen, i have tried
running the kill.exe screensavername.scr command and still the screensaver
does not end. Tag: Find Disabled accounts and then enable accounts Tag: 161696
How to use response.write (quotation problem) please help!
Hello,
I am trying to use the response.write method and I have two simple
questions.
Why do I see it two forms of response.write?
1. Response.write("<HTML CODE>")
2. Response.write "<HTML CODE>" (sometimes with "(" sign and sometimes
without)
Second question:
Using this method you need to use quotation marks at start and at the
end. What if my HTML code uses quotation itself? Can I have something
like that
Response.Write("<FONT face="Geneva, Arial, Helvetica" size=2>")
The problen is how will the server know which " sign is the last one?
Is there any article about this subject or something?
Thanks in advance Tag: Find Disabled accounts and then enable accounts Tag: 161693
populate 2nd combo box based on value selected in 1st
hi,
would anyone be able to tell me how to dynamically populate a 2nd combo box
based on a value selected in the 1st combo box? I'm thinking that it must be
a onchange event from the first combo box but i don't know what the event is.
the values will be pulled from a database and i'm creating an ASP page so
vbscript or javascript would be useful Tag: Find Disabled accounts and then enable accounts Tag: 161692
Can't execute WSH script from bat file
We're trying to trigger execution of some WSH scripts from a batch file
which in turn is called from an ASP script. The ASP code looks like:
<%
Dim oShell,sResult,sPath
Set oShell = Server.CreateObject("Wscript.Shell")
sPath= server.MapPath("test.bat")
sResult = oShell.run(sPath, 0, FALSE) 'asynchronous
Response.Write sResult
%>
The batch file code looks like:
cd <Full path to application directory>
FACSV.wsf E
NonFACSV.wsf E
Now, the problem is that the batch file executes correctly, but
both the WSH scripts are not executed. But if the scripts are
executed on the Windows 2000 command line directly, they work ok.
The same setup works ok on our test server, but not on client's
server having similar configuration. What can be the problem?
Thanks in advance. Tag: Find Disabled accounts and then enable accounts Tag: 161691
Listing Windows Components from script
Hello,
I've started a project at Sourceforge, it's a vbscript which goal is to
simplify the task of documenting Windows servers. It collects information
through WMI and writes the results to a Word file. I'm able to get quite a
lot of information from the target computer, and it looks quite nice at
present. I would however like to be able to list Windows Components, so I
can include IIS, DNS, DHCP and such in the documentation.
So my question; does anyone know of a way to get this information with a
script?
The project is called SYDI (Script Your Documentation Instantly) and is
found here: http://sydi.sourceforge.net/
It would also be nice with some feedback on the script, so please test it :)
Best regards
Patrick Tag: Find Disabled accounts and then enable accounts Tag: 161687
Is it possible to get the name of a variable?
For error trapping on an asp page, I'd like to print out the name of a
variable if I find it to be null, a zerolength string, etc...
for example:
aBadString = "a"
aBadString = ""
If CheckForZeroLengthString(aBadString) then
Response.write("The variable with a zero-length string is: " &
aBadString.name)
you can't do aBadString.name, so how do you get a variable's name?
Thanks,
Mike Tag: Find Disabled accounts and then enable accounts Tag: 161686
search a text file for certain strings... help!
what i'm trying to do is to get a .vbs file to search through a text
file and find certain strings throughout the text file and then
automatically put them into the clipboard... any help will be
appreciated ;)
ghettocow Tag: Find Disabled accounts and then enable accounts Tag: 161684
Number of unread e-mails displayed by login script - Exchange 2003
We are running Win 2k and Win XP workstations in an SBS 2003 environment.
A VBScript login script maps network drives and displays a dialog with
current time. I'd also like have that dialogue box show the user how many
unread e-mails are in his/her Exchange 2003 inbox. Displaying information
about number of unresolved tasks and or appointments for the day would be
nice also but not needed.
I'm not a super script wiz but can piece together bits that I come across.
Any help would be appreciated.
Thanks in advance,
Shawn Witt Tag: Find Disabled accounts and then enable accounts Tag: 161683
ADO Error catching
Hi All,
I currently am using the following in an attempt to catch and display custom
errors (VBScript/Classic ASP):
Private Sub PublishError (number, section, message)
On Error Goto 0
Call Err.Raise(number, section, message)
Err.Clear
End Sub
I then call it something like:
If Not IsObject(i_objConnection) Then PublishError 1, "Database Connection",
"Connection object not initialised"
This works well for me until I try to catch a connection error as below:
On Error Resume Next
i_objConnection.Open strConn
If Err.Number <> 0 Then
PublishError 2, "Database Connection", "A connection to the database
could not be made, check strConn"
End if
The strange thing is that if I Response.Write Err.Source and Err.Description
directly after calling PublishError I get the raised error properties.
I would appreciate a fresh pair of eyes on this, any help appreciated.
Colin Tag: Find Disabled accounts and then enable accounts Tag: 161681
need a solution to a common problem
brief overview of situation:
programs on removable disk (zip) that use ini files to store
configuration, which includes where to look for other configuration
information.
the problem:
public computer labs have different drive letters for the removable
disk drive, so I have to reconfigure the software every time I use a
computer with a different letter for the drive.
solution (the part I'm hoping somebody here can help me with):
write a script that detects what drive letter the disk is at, and then
replaces all the file paths in the ini files with the corrected drive
letter (i.e. search for d:\ replace with 'driveletter':\
The only part of the file path that ever changes (both to the ini
file, and IN the ini file) is the drive letter.
I've found bits and pieces of what I'd need to do this, except how to
do a search and replace on multiple files in multiple locations.
here's the basic concept I've got so far:
OldLetter="d"
DriveLetter = 'driveletter of disk' !--look by volume serial, disk
name, or disk properties
open DriveLetter:\filepath1 for editing
find OldLetter":\"
replace with DriveLetter":\"
close DriveLetter:\filepath1
open DriveLetter:\filepath2 for editing
find OldLetter":\"
replace with DriveLetter":\"
....
Can somebody help me out? Tag: Find Disabled accounts and then enable accounts Tag: 161679
Active Directory OU Help
Hey there. So I'm trying to write a script that will create 2 securit
groups within an OU named %OU Name% - Site Administrators and %OU Name
- Site Users. But I'm not having much luck.
Here's what I've got so far:
Const ADS_GROUP_TYPE_GLOBAL_GROUP = &h2
Const ADS_GROUP_TYPE_SECURITY_ENABLED = &h80000000
Set objOU = GetObject("LDAP://OU=Groups,OU=ATGA,OU=Sout
Eastern,OU=Locations,DC=CORVEL,DC=com")
Set objGroup1 = objOU.Create("Group", "cn=ATGA - Site Administrators")
objGroup1.Put "sAMAccountName", "ATGA - Site Administrators"
objGroup1.Put "groupType", ADS_GROUP_TYPE_GLOBAL_GROUP Or
_ADS_GROUP_TYPE_SECURITY_ENABLED
Set objGroup2 = objOU.Create("Group", "cn=ATGA - Site Users")
objGroup2.Put "sAMAccountName", "ATGA - Site Users"
objGroup2.Put "groupType", ADS_GROUP_TYPE_GLOBAL_GROUP O
_ADS_GROUP_TYPE_SECURITY_ENABLED
objGroup1.SetInfo
objGroup2.SetInfo
Basically with the way it is now, I have to go through and replace th
OU name 5 times, which isn't exactly a time saving process. Can anyon
help me optimize it, or make it work better? Thanks
-
Aumi
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
----------------------------------------------------------------------- Tag: Find Disabled accounts and then enable accounts Tag: 161674
Problem accessing HKEY_USERS on remote machine via WMI
What I'm trying to do is access HKCU on remote machine.
Particulary, I'm trying to read
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Zones\3 key, entry named "1001".
First I determine what user is currently logged on to the
machine, then I retrieve users SID and then i access
HKEY_USERS/SID branch. Thats where problems start.
Here is the script:
---START---
strComputer = "JEFF"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")
Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer in colComputer
strUlogiraniKorisnik =
Mid(UCase(objComputer.UserName),InStr(UCase(objComputer.UserName),"\")+1)
strDomena = Mid(UCase(objComputer.UserName),1,InStr(UCase(objComputer.UserName),"\")-1)
Next
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_UserAccount where name='" & strUlogiraniKorisnik & "' and
domain='" & strDomena & "'",,48)
For Each objItem in colItems
strSIDKorisnika = objItem.SID
Next
Const HKEY_USERS = &H80000003
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"
& _
strComputer & "\root\default:StdRegProv")
strKeyPath = strSIDKorisnika &
"\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3"
strEntryName = "1001"
objReg.GetDWORDValue HKEY_USERS,strKeyPath,strEntryName,dwValue
Wscript.Echo "Value is:" & dwValue
---END---
I know that Windows 2000 with SP4 has bug explained on
http://support.microsoft.com/?id=817478 but is there another
way to access HKCU on remote machine?
Drazen Tag: Find Disabled accounts and then enable accounts Tag: 161671
Need Suggestions for Technical Documentation Tool
Hi,
I am looking for suggestions for a Technical Documentation tool for our IT
department.
What are people using?
After a short search on the internet, I was able to find a decent product at
http://www.livingaddress.com/livdoc/eng/livingdoc.asp named LivingDoc 2.5. I
evaluated it for 2 weeks, and although I liked some of its features, I
decided against purchasing it because:
- the cost seems a little excessive ($1500 for 1 user) for what the product
does
- there have been no new versions or updates to the product in over 2 years
- support is limited to email, and they provide no phone number except for
sales
The main appeal of this specific tool is that it mostly automates the
archiving of the code, and the hyperlinking of an application's different
components. See http://www.livingaddress.com/docdemo/ for a sample output.
I just have a hard time believing there isn't an alternative to this $1500
tool out there.
Any suggestions will be appreciated... Thanks in advance!
GSM Tag: Find Disabled accounts and then enable accounts Tag: 161669
how to execute a .bat file
Hello all,
ok, here it is, I have a file say we call it "test.bat" and it is on the
root of C:\. This computer is a remote computer. From my source I have wrote
some code using Visual Basic 6, designed some forms and I can do what I have
to. I can copy files, delete and move files on the remoted computer. The
problem is when I try to execute the .bat file. The file runs on the source
computer and not on the remote. What am I doing wrong?
Thank you. Tag: Find Disabled accounts and then enable accounts Tag: 161664
HTA application and VBScript to retreive Login Name
Hi'
I'm working on a HTA application for a local intranet, and I want to
retreive the Username and machine name so I don't have to request users
to login again.
I have found this but it's always empty.
Set oWshNet = Wscript.CreateObject("Wscript.Network")
sUser = oWshNet.Username
SCompName = oWshNet.Computername
Does someone have an idea?
Thank you.
Michel
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: Find Disabled accounts and then enable accounts Tag: 161661
Reading Membership of NT 4.0 Groups
I am working on a script that would read Windows NT 4.0 Group membership. I
have the code for Windows 2000 but would like to convert it to NT 4.0. I
have enclosed it. Please advise.
Option Explicit
Dim objConnection, objCommand, objRootDSE, strDNSDomain, strQuery
Dim objRecordSet, strDN, objGroup
'===========================================================================
======
'===========================================================================
======
'Main Body
'
' Use ADO to search Active Directory.
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
' Determine the DNS domain from the RootDSE object.
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
' Search for all groups, return the Distinguished Name of each.
strQuery = "<LDAP://" & strDNSDomain _
& ">;(objectClass=group);distinguishedName;subtree"
objCommand.CommandText = strQuery
objCommand.Properties("Page Size") = 100
objCommand.Properties("Timeout") = 30
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
If objRecordSet.EOF Then
Wscript.Echo "No groups found"
objConnection.Close
Set objRootDSE = Nothing
Set objConnection = Nothing
Set objCommand = Nothing
Set objRecordSet = Nothing
Wscript.Quit
End If
' Enumerate all groups, bind to each, and document group members.
Do Until objRecordSet.EOF
strDN = objRecordSet.Fields("distinguishedName")
Set objGroup = GetObject("LDAP://" & strDN)
Wscript.Echo objGroup.sAMAccountName _
& " (" & GetType(objGroup.groupType) & ")"
Call GetMembers(objGroup)
objRecordSet.MoveNext
Loop
' Clean up.
objConnection.Close
Set objRootDSE = Nothing
Set objGroup = Nothing
Set objConnection = Nothing
Set objCommand = Nothing
Set objRecordSet = Nothing
'===========================================================================
================
'===========================================================================
================
'Procedures
Function GetType(intType)
' Function to determine group type from the GroupType attribute.
If (intType And &h01) <> 0 Then
GetType = "Built-in"
ElseIf (intType And &h02) <> 0 Then
GetType = "Global"
ElseIf (intType And &h04) <> 0 Then
GetType = "Local"
ElseIf (intType And &h08) <> 0 Then
GetType = "Universal"
End If
If (intType And &h80000000) <> 0 Then
GetType = GetType & "/Security"
Else
GetType = GetType & "/Distribution"
End If
End Function
' Sub Template
Sub GetMembers(objADObject)
' Subroutine to document group membership.
' Members can be users or groups.
Dim objMember, strType
For Each objMember In objADObject.Members
If UCase(Left(objMember.objectCategory, 8)) = "CN=GROUP" Then
strType = "Group"
Else
strType = "User"
End If
Wscript.Echo " Member: " & objMember.sAMAccountName _
& " (" & strType & ")"
Next
Set objMember = Nothing
End Sub
'===========================================================================
================= Tag: Find Disabled accounts and then enable accounts Tag: 161657
how to activate running app from background?
yes, is it possible to activate an application that is
already running in the background - bring it to the
front? I have a script to startup an application (an
Access mdb for example). If the Access mdb is already
running in the background and the user tries to start it
up, I don't want to start up a new instance, but instead
activate the instance that is already running - bring it
to the front. Is this doable? How to do? I experimented
with
Set AccObj = GetObject(Path & appName)
But where to go from there?
Thanks,
jj Tag: Find Disabled accounts and then enable accounts Tag: 161655
Looking for SNMP COM
Gang,
I'm looking for a free/cheap SNMP COM object that will let me query SNMP on
non-standard ports (IE - our SNMP agents listen on a port other then 161).
All it needs to do is be able to walk the tree and return the OIDs nested
inside it - that's all. I've been looking for this for a long time and can't
seem to find anything simple enough to do it. All the simple COMs only talk
on 161, and the others are huge expensive suites I don't need. So does
someone out there have an idea? Thanks. Tag: Find Disabled accounts and then enable accounts Tag: 161653
Adding Administrators Group to Domain Admins Group in Windows NT
Everyone,
I am working to over ride NT 4.0 limitations and attempting to nest a local
group, Administrators, in a Global Group, domain Admins.
If not, I would like to script the adding of the Administrators group from
the PDC to all members of the NT domain. Please advise. Tag: Find Disabled accounts and then enable accounts Tag: 161652
Retrieving an Item Count from a Public Folder
I am trying to write a simple VBScript that queries the number of
items in a public folder on Exchange 5.5. I will then move items to
another public folder is a certain item count is exceeded.
What is the best way to access a public folder via VBScript? Does
anyone have any code samples to demonstrate this action? Tag: Find Disabled accounts and then enable accounts Tag: 161650
Catching detailed runtime error description from a VB script
Hi
I am looking for a way to capture error messages at runtime for VB scripts.
I cannot use the Err object, because it does not contain information about
what actually went wrong (what line in the code, what
function/method/property call etc.).
So, then I thought of using linenumbering and the Erl function, only to
realize that VB scripts do not support linenumbering.
By now, frustration is building up....
If you have found a way to solve this issue, I would LOVE to hear from you
:-)
//Geir Tag: Find Disabled accounts and then enable accounts Tag: 161649
LDAP query from child domain
When I logon top domain and trying to LDAP query from child domain I get no
results, no errors, and object are there, When I logon child domain, script
works fine. I have domain admin rights to child domain when logon to top
domain. What can I do?
Set con = CreateObject("ADODB.Connection")
con.Provider = "ADsDSOObject"
con.Open "Active Directory Provider"
Set Com = CreateObject("ADODB.Command")
Set Com.ActiveConnection = con
' This works fine
Com.CommandText = "select name from 'LDAP://DC=citaron,DC=net' where
objectCategory='group' ORDER BY NAME"
' This dosen't work
Com.CommandText = "select name from 'LDAP://DC=edu,DC=citaron,DC=net' where
objectCategory='group' ORDER BY NAME"
Set rs = Com.Execute
While Not rs.EOF
msgbox rs.Fields("Name")
rs.MoveNext
Wend Tag: Find Disabled accounts and then enable accounts Tag: 161648
Vbscript causing problems with Internet Security Settings
Dear members and gurus,
I am very new in vbscript and internet security. I created a button on my
website that will call a vbscript function to launch an application located
on the user's computer. The vbscript is as follow:
*************************************************************
Dim fso,WshShell
set fso=CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WScript.Shell")
if fso.FileExists("C:\Program Files\IEBAudioRecorder\test.txt") then 'path
to the file
msgBox("File Exists")
WshShell.Run("C:\Progra~1\IEBAud~1\AudioRecorder.exe") 'run application
else
msgbox("file not found, please download it")
WshShell.Run("http://blackfeet:90/library/IEBSoundRecorder.exe") 'download
installer from the server
end if
set fso=nothing
set WshShell=nothing
*************************************************************
I noticed that if the user's internet setting is set to default(disable) for
"Initialize and script ActiveX controls not marked as safe", the vbscript
would not run and my application could not be launched.
If it is changed to "Enable", a message box will pop up everytime the button
tries to run the vbscript, saying "An ActiveX control on this page might be
unsafe...Do you want to allow this interaction? Yes/No". I am testing on IE6.
How could I solve this problem (allow the vbscript and the application to
run, and eliminate the pop up window) without asking the users to change
their internet security settings? Is there any other methods to solve this,
as I think requesting users to edit their security settings might risk them
to malicious scripting.
How can I initialize and script activeX controls to marked as safe? Is it
possible to sign my vbscript a digital certificate like those for
exe/cab/ocx? I sincerely hope that someone could share with me their
knowledge and experience on this matter as I am totally helpless. Looking
forward to some replies soon.
Thanks in advance Tag: Find Disabled accounts and then enable accounts Tag: 161641
VBCRLF
I have the following lines but cannot figure out how to include a Carrage
Return Line Feed so I can split the lines when constructing the E-Mail
BodyText = "Your details are as follows :" & VBcrLf 'Does not work
BodyText = BodyText & "Click on the link to proceed
http://www.raymarine.com"
Document.location "mailto:info@zippytech.co.uk&Subject=Warranty Logon
Details&Body=" & BodyText
I have tried VbCrLF but cannot seem to get this to work in VBScript. Can
anybody shed some light on how I could do this.
Many thanks Tag: Find Disabled accounts and then enable accounts Tag: 161640
Code not working..........
Hi,
Following code is not working on my m\c.
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Echo WshShell.CurrentDirectory
Everytime i get the following error :-
Microsoft VBScript runtime error: Object doesn't support this propert
or method: 'CurrentDirectory'
Please help !!!
Regards
Arpit
-
arpita_singha
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
----------------------------------------------------------------------- Tag: Find Disabled accounts and then enable accounts Tag: 161639
How to set permission for Shell.Application when using BrowseForFo
I tried to use Shell.Application BrowseForFolder to allow myself to
browse the windows folders from within a script block in HTML web page. I
can fully control the server and can setup the permission whatever I want.
I am using the following code but when I invoked it, it always says
"Permission Denied" at this step "set objFolder = objShell.BrowseForFolder(0,
"Example", 0, ssfWINDOWS)". I don't know what permission I need to grant to
whom... Help...
<script language="VBScript">
function fnShellBrowseForFolderVB()
dim objShell
dim ssfWINDOWS
dim objFolder
ssfWINDOWS = 36
set objShell = CreateObject("Shell.Application")
set objFolder = objShell.BrowseForFolder(0, "Example", 0,
ssfWINDOWS)
if (not objFolder is nothing) then
'Add code here.
end if
set objFolder = nothing
set objShell = nothing
end function
</script> Tag: Find Disabled accounts and then enable accounts Tag: 161637
create a local port (file)
Hi,
with "prnport.vbs" placed in system32 of Windows 2003 and XP I can create a
TCP/IP port.
How can I create a port like "D:\printer.prn"?
Please help
Martin Tag: Find Disabled accounts and then enable accounts Tag: 161635
how to specify the page looks in window onload??
I have a page1 that opens a window called page2.
I want page2 doesn't have title bar, tool bar, address bar. Is it possible
to specify in javascript function window_onload() in page2? I don't want
to specify in window.open() in page1 when it loads page2.
<script type="text/javascript">
function window_onload()
{
}
</script>
<body onLoad="window_onload()"> Tag: Find Disabled accounts and then enable accounts Tag: 161628
run macro from VBScript
Is it possible to run a macro from a vba module from a script? I have a
form in Outlook that I would like to have run a macro in the same
application.
thanks
Neil Tag: Find Disabled accounts and then enable accounts Tag: 161626
Script to remove all network printers.
Hi there,
We are trying to allocate printers by OU. We have loopback enabled on a
group policy and it runs the following script:
Set WshNetwork =CreateObject("WScript.Network")
PrinterPath ="\\servername\HP4300n"
WshNetwork.AddWindowsPrinterConnection PrinterPath
WshNetwork.SetDefaultPrinter PrinterPath
That scripts works excellently for connecting to a shared printer and
setting it as default, but it leaves existing printers connected. In a
school, that is not desirable as kids will be printing to different rooms. I
wish to insert a line in the above script that will delete ALL existing
printers before setting the 'proper' default one. I presume that I need to
use the 'RemovePrinterConnection' property, but I don't know how to use it
when you don't actually know the name of the printer you want to disconnect.
Any help would be greatly appreciated.
Thanks. Tag: Find Disabled accounts and then enable accounts Tag: 161623
How do I save Attchment of type CdoEmbeddedMessage to file system?
I want to save email attachment which is of type CdoEmbeddedMessage to
a file system (say, C:\temp directory) using Active Server pages (CDO
prefered)!!!
Any help is appreciated...asap....THX. Tag: Find Disabled accounts and then enable accounts Tag: 161621
How to consume webservice using VBScript???
Hi, I really need to figure this out...
I'm trying to use VBScript to consume a webservice. I would like to
do this without making a reference to the soap client.
So what I have found so far is this:
Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
and I can make a post method using the xmlhttp object.
I have a helloworld webservice that I created,
---------------------------------------------------------------------------
The following is a sample SOAP request and response. The placeholders
shown need to be replaced with actual values.
---------------------------------------------------------------------------
POST /CreateFileService/Service1.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/HelloWorld"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<HelloWorld xmlns="http://tempuri.org/" />
</soap:Body>
</soap:Envelope>
--------------------------------------------------------------------------
But I"m not sure how I can use the VBScript to make a request to this
service... where the 'length' is the placeholder.
I'm new to VBScript and making SOAP calls, can someone please help me? Tag: Find Disabled accounts and then enable accounts Tag: 161620
ADO client disconnects after running a long query
I am having a problem executing long running queries from an ASP application
which connects to SQL Server 2000. Basically, I have batches of queries that
are run using ADO in a loop written in VBScript. This works pretty well
until the execution time of a single query starts to exceed some threshold,
which I am trying to narrow down. I can typically run 2 - 10 queries in a
loop, with the run time being anywhere from under a minute to an hour or
more. Now that this application is being subjected to run against some large
databases (25 - 40G), I'm having problems getting the application to
continue beyond the first query if it takes a while to run.
I used SQL Profiler to try to diagnose what was going on. I can see the
query executes to completion, but immediately after completing I can see an
"Audit Logout" message, which apparently means that the client has
disconnected. The query durations vary from 45 or 50 minutes to up to over
90 minutes. I have the ADO connection and query timeouts set to very large
values, e.g. 1000 minutes, so I can't think its that. My guess is that there
is some IIS setting or timeout that I am running up against and the
connection to SQL Server is just dropped for some reason.
The configuration is
NT 4.0 SP6
SQL Server 2000 SP3
IIS 4.0
Internet Explorer 5.5
I'm only running into this problem on the very largest databases we run
against. The vast majority continue to function properly, but this is going
to happen more often as time goes on the databases continue to grow in size.
Any advice is appreciated,
-Gary Tag: Find Disabled accounts and then enable accounts Tag: 161618
VBScript Debugging Tool
Hi All,
Is there a way, or a tool, that can debug vbScript, line by line?
Thanks Tag: Find Disabled accounts and then enable accounts Tag: 161616
Get current woking directory
Hi,
How can i get the path of current working directory in VBScript
-
arpita_singha
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
----------------------------------------------------------------------- Tag: Find Disabled accounts and then enable accounts Tag: 161615
Script for checking remote hosts
Hi,
i am searching for a script to check remote hosts - list of remote hosts is
taken from a txt-file.
For example: Checking on remote hosts the existance of a special service -
clients without this service have to be written to a output file
please reply via email to martin.malsch@dhl.com
rgds
Martin Tag: Find Disabled accounts and then enable accounts Tag: 161612
Hi
1.- Is there a script that can find all the accounts that are disabled in an
OU??
2.- Is there a script that enables those accounts??