Errors 70 & 424?
The script:
On Error Resume Next
Const HKCU = &H80000001 ' HKEY_CURRENT_USER
Const ForReading = 1
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\"
& _
"ZoneMap\Domains"
strAOLKeyPath = "\aol.com"
strNapsterKeyPath = "\napster.com"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = _
objFSO.OpenTextFile("C:\Documents and Settings\MyUser\Desktop\computers.TXT")
strComputers = objTextFile.ReadAll
objTextFile.Close
arrComputers = Split(strComputers, vbCrLf)
Set objShell = CreateObject("WScript.Shell")
For Each strComputer In arrComputers
strCommand = "%comspec% /c ping -n 3 -w 1000 " & strComputer
Set objExecObject = objShell.Exec(strCommand)
strText = objExecObject.StdOut.ReadAll
If Instr(strText, "Reply") > 0 Then
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objConn = objLocator.ConnectServer(strComputer, "root\cimv2")
Set objReg = GetObject("winmgmts:\\" & strComputer & _
"\root\default:StdRegProv")
WScript.Echo("For workstation " & strComputer & ":")
objReg.DeleteKey HKCU, strKeyPath & strAOLKeyPath
If Err.Number = 0 Then
WScript.Echo(vbTab & "Deleted key: " & strAOLKeyPath & _
" if it existed.")
Else
WScript.Echo(vbTab & "Error number " & Err.Number & " occurred.")
End If
objReg.DeleteKey HKCU, strKeyPath & strNapsterKeyPath
If Err.Number = 0 Then
WScript.Echo(vbTab & "Deleted key: " & strNapsterKeyPath & _
" if it existed.")
Else
WScript.Echo(vbTab & "Error number " & Err.Number & " occurred.")
End If
Else
WScript.Echo strComputer & " could not be reached."
End If
Next
The problem:
Several of the machines return error 70, helpfully defined as "Permission
denied." Three of them return error 424, mysteriously defined as "Object
required."
I'm running the script while logged into a server as a domain admin, and
said server can ping every machine, so connectivity is not an issue. Can
anyone explain the above errors and how I might fix them? The script ran
against most of the machines just fine, removing the registry keys I wanted
removed.
Thanks in advance! Tag: Save a encoded MS-Word document to a text file Tag: 208425
Set File/User Permission with ASP/VBScript to a File
hi
i would like to add a user and set file permission to a file with ASP.
(No component). is that possible ?
do you have a link ? an example ?
thanks david Tag: Save a encoded MS-Word document to a text file Tag: 208422
check for file
hey all,
how do i check if a file exists and then if it does run a batch file?
thanks,
rodchar Tag: Save a encoded MS-Word document to a text file Tag: 208420
Vista & Windows Scripting Components (WSC)
I have windows vista business edition - upgraded from winXP. This is
my dev workstation. Vista would not identify WSCs with the
scrobj.dll file so I had to do this manually. On XP one could right-
click and select "register component." I am not getting this option
with Vista.
So the question is...to I have to go command line with the regsvr32 ad
register each of the 50 components I have? Or can I do this another
way?
Thanks!
Rus Tag: Save a encoded MS-Word document to a text file Tag: 208417
Auto Emails Without User Intervention
I have this task of sending emails using vbscript ASP Classic. I want to send
emails to users based on a certain criteria. For example, if a user has to
renew membership an automatic email would be sent to remind them. This is
done from the web application with out any intervention.
I tried using the Application Object in Global.asp, but don't have much
knowlege about using it. Can some out help with this problem?
Thanks
--
techno_zed Tag: Save a encoded MS-Word document to a text file Tag: 208414
"time to display the list of operating systems"
Does anyone know how I can script a change in windows 2003 to change
the "time to display the list of operating systems" value from 30 sec.
to 5 sec.? This
is located under startup and recovery under system properties. I have
to change this setting on 100 servers and would rather run a script/
vbscript
than change it manually for obvious reasons. Tag: Save a encoded MS-Word document to a text file Tag: 208412
Help with VBscript to calculate total order discount on sales cart web
Hi I am new at this, and am trying to cusomize a sales cart
application for my web.
The boxed application allows you to select either discounts per item
or whole order discounts. All of my products would fit into the whole
order discount category, but I have one that is not elligeble for a
discount at all!
The whole order discount is setup to start when order total is equal
or over $600 and the discount ammount is a fixed amount of $60. The
item that is not elligeble for a discount costs $1215. How can I
modify the code to put an exclusion criteria for that item when
calculating the whole order discount?
Here is the code on the page:
<%@ LANGUAGE="VBScript.Encode" %>
<!--#include virtual="/cgi-bin/GetOrder.asp"-->
<!--#include virtual="/cgi-bin/codepage.asp"-->
<!--#include virtual="/cgi-bin/ADOVBS.inc"-->
<!--#include virtual="/cgi-bin/IASUtil.asp"-->
<%
coupon = FGETVar("coupon","","s")
'READ STUFF From Database
Dim objSimpleAdo, rstRS, SQLStmt
SQLStmt = "SELECT * From item "
SQLStmt = SQLStmt & "WHERE [Orderid] =" & Order & "; "
Set SimpleAdo = New CSimpleAdo
SimpleAdo.setConnectionString = Session("ConnectionString")
Set RS = SimpleAdo.getRecordSet(SQLStmt)
'Do stuff with the record set
'Initialize variables for this application
thedate = Cstr(Date) 'get the date
thetime = Cstr(Time) 'get the time
subtotal = 0 'the subtotal for a row of items
subweight = 0 'the subweight for a row of items
subsize = 0 'the subsize for a row of items
subquantity = 0 'the subquantity for a row of items
subship = 0 'the subshipping for a row of items
subhand = 0 'the subhandling for a row of items
%>
<%
'Calculate the individual totals for a row
subweight = subweight + (RS("Quantity") * RS("Weight"))
subsize = subsize + (RS("Quantity") * RS("Size"))
subtotal = (RS("Quantity") * RS("Price"))
subquantity = subquantity + RS("Quantity")
subship = subship + (RS("Quantity") * RS("ExtraShip"))
subhand = subhand + (RS("Quantity") * RS("ExtraHand"))
total = MyCurrency (CCur(subtotal))
grandtotal = grandtotal + subtotal
%>
'Do item discount
If RS("Price") <> 0 Then
If RS("Price")/RS("RawPrice") <> 1 Then
itemdiscount = 100-(RS("Price")/RS("RawPrice") * 100)
strdisplay = "<font color=#BB0000> (" & Round(itemdiscount,2) & "%
off)</font>"
Response.write(strdisplay)
End If
End If
'Here is where I think the code should be modified. I tried several
ways but it does not work
<%'do whole order discount here Original
'Dim discountarray(1)
Set DiscountObj = New CDiscountObj
'If RS("Price") = 1215 Then
'discountarray = DiscountObj.wholeDiscount (subtotal + 60)
'Else
discountarray = DiscountObj.wholeDiscount (grandtotal)
'End If
'discountarray(1) = DiscountObj.wholeDiscount (grandtotal)
'discountarray(2) = "HELOOOOOOOOOOOO"
Set DiscountObj = Nothing
'Next do COUPON DISCOUNTS
If Session("ChkCoupons") > 0 then
'Dim discountarray(0)
'If RS("Price") = 1215 Then
'discountarray = 0
'Else
Set DiscountObj = New CDiscountObj
discountarray = DiscountObj.couponDiscount (discountarray,coupon)
Set DiscountObj = Nothing
'End If
End If
%>
<%
If discountarray(0) = 1 Then
If RS("Price") = 1215 Then
Response.write("<font color=#BB0000>(Total was " & MyCurrency
(CCur(discountarray(1))) & " Discounts do not apply to webinars)</
font>")
Else
Response.write("<font color=#BB0000>(Total was " & MyCurrency
(CCur(discountarray(1))) & " Discount of $60.00 Applied)</font>")
Response.write (MyCurrency (CCur(RS("Price"))))
End IF
End If
%>
Any help would be appreciated!
PS. I omited the HTML tables that display the results. Tag: Save a encoded MS-Word document to a text file Tag: 208411
System Event Log Reading
I have a need to query the System Event Log and I'm using the following
query.
Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'System'")
For Each objEvent in colLoggedEvents
do stuff
Next
Is it safe for me to assume that the log will ALWAYS be read starting from
the most recent event, so when I find the first occurance the
objEvent.EventCode I'm looking for it will ALWAYS be the most recent? If
not, what steps do I have to take to ensure that?
Thanks,
Tom Tag: Save a encoded MS-Word document to a text file Tag: 208405
Forcing a refresh of Network Printer Settings from Print Server
Hello Guys,
Is there a way via scipting to force a pc to refresh their local printer
settings from the print server ? We have enabled Duplexing as the default for
printing ( conserve that paper ! :) ) for our HP Laserjet printers on the
Print Server, but if a user goes on their local printer settings and unchecks
duplexing, it will not re-pull that device setting from the print server
unless you delete and then re-add the printer on the local machine. Is there
a way to have the printer settings pulled from the server without have to
delete and then readd the locally installed network printer ? Tag: Save a encoded MS-Word document to a text file Tag: 208403
Help required to script a message
Hi,
Can someone help me out with the below problem?
I have a grid and each row has a checkbox as the first column. In case
if they want to edit or send a mail, they can tick the check box and
click the edit button.
In case if they have selected more than one row by ticking the check
box and click on edit, I want to display a message in the client side
saying select only one record.
Since I am using ASP.Net/VB.net I can't use a msgbox as it will be
displayed in the server only.
As I have no experience with script, can someone help me with some
code pls?
Thnx,
Vithya Tag: Save a encoded MS-Word document to a text file Tag: 208402
Scripting Groups
Hi all, i have the following script that i have tried to piece
sections from two scripts together, my overall aim is to have the
local machine that this script is run on, added to the group specified
in objGroup....
and i deperate for help - not sure what i'm doing wrong....
many thanks in advance
Jason
--------------------------------------------------------------------------------------------------------------------------------------------
' Constants required for name translate
Const ADS_PROPERTY_APPEND = 3
Const ADS_NAME_INITTYPE_GC = 3
Const ADS_NAME_TYPE_NT4 = 3
Const ADS_NAME_TYPE_1779 = 1
'Get the NETBIOS name of the domain
Set objSystemInfo = CreateObject("ADSystemInfo")
Set objGroup = GetObject ("LDAP://cn=Adobe Reader 8,ou=software
distribution,ou=distribution groups,ou=********,dc=********,dc=local")
strDomain = objSystemInfo.DomainShortName
' Get the name of the computer
set objNetwork = createobject("Wscript.Network")
strComputer = objNetwork.ComputerName
' Call function to return the distinguished name (DN) of the computer
strComputerDN = getComputerDN(strComputer,strDomain)
function getComputerDN(byval strComputer,byval strDomain)
' Function to get the distinguished name of a computer
' from the NETBIOS name of the computer (strcomputer)
' and the NETBIOS name of the domain (strDomain) using
' name translate
Set objTrans = CreateObject("NameTranslate")
' Initialize name translate using global catalog
objTrans.Init ADS_NAME_INITTYPE_GC, ""
' Input computer name (NT Format)
objTrans.Set ADS_NAME_TYPE_NT4, strDomain & "\" & strComputer & "$"
' Get Distinguished Name.
getComputerDN = objTrans.Get(ADS_NAME_TYPE_1779)
end Function
'MsgBox strComputerDN
objGroup.PutEx ADS_PROPERTY_APPEND, "member", strComputerDN
objGroup.SetInfo
------------------------------------------------------------------------------------------------------------------------------------------- Tag: Save a encoded MS-Word document to a text file Tag: 208401
changing appeareance settings with a script
I need to make several changes in the appearance tab of the display
properties on several machines.
This is an overview of the items I need to change
- Font size: Extra Large
- advanced:
- Active Title bar: size, font and fond size
- Caption Buttons: size
- Icon: size, font and fond size
- ....
Is there anyone who knows how this best can be done using a scrip or
any other way? Tag: Save a encoded MS-Word document to a text file Tag: 208399
Microsoft.XMLHTTP
I have used the "Microsoft.XMLHTTP" object in ASP numerous times, but I
can't get it to work in a VBS script to save my life.
Does anyone have an example of loading a web page from a VBS file?
Thanks! Tag: Save a encoded MS-Word document to a text file Tag: 208389
active directory script to reset passwords
Hello all,
I am trying to write a script that will reset all user account
passwords under a specific OU. This part i have accomplished. I
would like the script to reset ALL user accounts though, including
child containers. My script only resets the passwords in the first OU
and will not go into the underlying containers. Any help would be
greatly appreciated. Please see my existing code below. Thanks in
advance!!!!
' VBScript to change a user's password
' ---------------------------------------------------------'
Option Explicit
Dim objOU, objUser, objRootDSE
Dim strContainer, strDNSDomain, strPassword
Dim intCounter, intAccValue, intPwdValue
Const ADS_SCOPE_SUBTREE = 2
' --------------------------------------------------------'
' Note: Change OU=nowhere, to reflect your domain
' --------------------------------------------------------'
strContainer = "OU=Remote Users, "
strPassword = "P@$$w0rd"
intAccValue = 544
intPwdValue = 0
intCounter = 0
' -------------------------------------------------------'
' Makes the user change P@$$w0rd password at first logon
' -------------------------------------------------------'
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
strContainer = strContainer & strDNSDomain
set objOU =GetObject("LDAP://" & strContainer )
objOU.Filter = Array("user")
For each objUser in objOU
If objUser.class="user" then
objUser.SetPassword strPassword
objUser.SetInfo
objUser.Put "pwdLastSet", intPwdValue
objUser.SetInfo
objUser.Put "userAccountControl", intAccValue
objUser.SetInfo
intCounter = intCounter +1
End if
next
WScript.Echo strPassword & " is Password. UserAccountValue = " _
& intAccValue & vbCr & intCounter & " accounts changed"
WScript.Quit Tag: Save a encoded MS-Word document to a text file Tag: 208387
Get the "target" property of shortcuts in a directory
Hi,
I'm new to scripting and could use some help please...
I need to get the target of all the shortcuts in users local profile
under the Recent folder (i.e. C:\Documents and Settings\<Username>
\Recent.
The goal is to see if any of their "recent files/folders" are
referencing URLs or using mapped drives.
I would like the script to:
1) get the list of shortcuts in the "Recent" folder for the logged in
user.
2) traverse the "target" property of each shortcut found.
3) log the targets to a text file.
I've written a script that can get the target property of a shortcut,
but that's as far as my scripting can take me... just starting out.
Thanks in advance! Tag: Save a encoded MS-Word document to a text file Tag: 208386
map drive based on computer name
Hi Everybody, I have been trying to map network drives based on the
computername but hava had little success. Computers are in different
locations. The first 5 letters are similiar for the first location,
for the second location, the first 5 letters are 61new. the script is
supposed to take the first five characters of the computername and run
a mapping of home drive and some network drives. It is greatly
appreciated if someone could give some suggestions or post a working
script. I know that the script could have the entries below. I put it
in a script but it didnot work.
thanks a lot.
++++++++++++++++++++++++++++++++++
Check if the drive(s) is there, leave them and just map the ones
missing
IF left(strCompName,4) = "61syd" THEN
MAPPING drives
end if
+++++++++++++++++++++++++ Tag: Save a encoded MS-Word document to a text file Tag: 208377
Add string to the System Variable "PATH"
Hi,
I'm looking for a script to add string at the begining of the System
Variable "PATH" Statement to deploy remotely VIA SMS. I've tried using SETX,
I didn't have much luck I can't modify the PATH I can instert any varible I
want but I can't edit the "PATH".
Thanks Tag: Save a encoded MS-Word document to a text file Tag: 208375
Validate entry from input box
In VBScript, how does one go about ensuring the response to an input box is
greater than 0 and less than 5? This also means error trapping for blank
entry and text entries, etc.
Your example script would be most helpful, thanks... Tag: Save a encoded MS-Word document to a text file Tag: 208373
the oShell.Run not working on remote server.
Hi,
I wrote a script which creates a batch file on the remote server and
tries to run from there itself.
This script is working in all the servers connected in network except
one. I checked the netlogon services and secondarylogon services both
of them are started. I checked the logon user id permissions its
having domain id rights.
Here is the script.
Set objFSO = CreateObject("Scripting.FileSystemObject")
strLine1 = "copy c:\ d:\" & " " & ">" & " " & Unescape("%22") & "d:
\test.txt" & Unescape("%22")
copy1 = "d:\copys.bat"
Set strFile1 = objFSO.CreateTextFile(copy1, True)
strFile1.WriteLine(strLine1)
strFile1.Close
Set oShell = CreateObject("Wscript.Shell")
nReturn = oShell.Run("cmd /c d:\copys.bat")
wscript.echo nReturn
this script runs fine on server A but in server B it doesnt even
initiates the line "CreateObject("Wscript.Shell")".
I'm not sure wat could be the reason.
any suggessions are gladly welcomed. Tag: Save a encoded MS-Word document to a text file Tag: 208372
getting date from day/month/year dropdowns
I am trying to use three dropdowns to capture a date from the user, one
for day, one for month and one for year. Once the user has selected
from the boxes, how do I convert these values to a date variable? My
code below does work, strBriefReceived = '//'.
Dim strBriefReceived
Dim dtmBriefReceived
strBriefReceived = CStr(briefreceivedday) & "/" &
Cstr(briefreceivedmonth) & "/" & Cstr(briefreceivedyear) & " " &
"00:00:00"
dtmBriefReceived = CDate(strBriefReceived)
<%
Response.Write "<select name=briefreceivedday>"
for i=1 to 31
if len(i)=1 then
i="0" & i
end if
if (diaryDay = clng(i))then
Response.write "<option value="& i &" selected>"& i
&"</option>"
else
Response.write "<option value="& i &">"& i &"</option>"
end if
next
Response.write "</select>"
Response.Write "<select name=briefreceivedmonth>"
for i=1 to 12
if len(i)=1 then
i="0" & i
end if
if (diaryMonth = clng(i))then
Response.write "<option value="& i &" selected>"& i
&"</option>"
else
Response.write "<option value="& i &">"& i &"</option>"
end if
next
Response.write "</select>"
Response.Write "<select name=briefreceivedyear>"
for i=2007 to 2015
if (diaryYear = i)then
Response.write "<option value="& i &" selected>"& i
&"</option>"
else
Response.write "<option value="& i &">"& i &"</option>"
end if
next
Response.Write "</select>"
%>
*** Sent via Developersdex http://www.developersdex.com *** Tag: Save a encoded MS-Word document to a text file Tag: 208369
"An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"
Dear Googlers,
we recently installed the sourceforge forum system on our server (MS
SQL 2005) and were excited how well it worked.
However, after the most recent MS update, and using the compiler
Visual Webdeveloper Express, we are suddenly receiving the error
message:
"An attempt was made to load a program with an incorrect format.
(Exception from HRESULT: 0x8007000B)"
Can you help us?
Many thanks,
Robert "Bobby" Tag: Save a encoded MS-Word document to a text file Tag: 208367
Run Script to change a password...
Help Pleaseeeeee!!!
Hi,
I made a script to change (or reset) the passwords of the domains users.
When I run the script using my domain admin account the script run
correctly, but when I use a user with only change password and reset password
permission the script donâ??t work, I receive a message "general deny access".
I use the delegate wizard in active directory to give access to manage users
password.
This is my script:
_____
strDomain = "domain.com"
strAccount = InputBox("User: ","Reset Password", "")
Set objUser = GetObject("WinNT://" & strDomain & "/" & strAccount & ",user")
objUser.SetPassword "newPassword"
Set objUser = Nothing
______
Thanks in advance, Walter. Tag: Save a encoded MS-Word document to a text file Tag: 208362
Search does not recongnize french characters
Hi,
Our website has a internal search page that searches all pages in the
site and returns a list of pages containing the words used to search on.
The search is done entirely in vbscript using regular expressions.
However, on the french side of our website...it doesn't recognize any
french characters and nothing gets returned.
I know it has something to do with the charset and codepage but I'm not
exactly sure what it is. I've tried a few different things but nothing
worked.
One of the meta tags is:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
Is this right? Do I need to add anything in vbscript as well?
Thanks
Rob
*** Sent via Developersdex http://www.developersdex.com *** Tag: Save a encoded MS-Word document to a text file Tag: 208358
Script to perform AD operation
Hi
Can any one suggest me script to perform the following Active Directory task
1. Domain Account User Logon Names
2. Domain Accounts with password aging greater than 4 months from the day
of the report (password will expire withing two months)
3. Date password expires
4. Domain Account Disply name
5. Domain Account Manager Name
6. First Name
7. Last Name
8. Company Name
I need to schedule these tasks on a weekly basis.
Please suggest at the earliest.
Thanks in advance
Regards Tag: Save a encoded MS-Word document to a text file Tag: 208356
fetching conversation content from mesanger
Hi,
After closing my Messenger chat with my friend, a log file is generated with
the conversation history in it.
I would like that a program which I develop will use the text which was
written and send to me, but I want to do it as much as can be done on real
time.
If the logfile is generated after the conversation was closed, I guess that
there is some sort of access to the data itself (before the conversation is
closed)?
Thanks,
Hanan. Tag: Save a encoded MS-Word document to a text file Tag: 208353
Hiding a user password in VB Scripting
This may be an FAQ but if it is then I have not been able
to find an answer. The question is: Is it possible to create
something similar to the InputBox function that hides the
user's password as he enters it? If so, how? Tag: Save a encoded MS-Word document to a text file Tag: 208349
Run batch\exe on remote PC
Hi all,
Is there a way to run exe on remote PC? I have two PCs connetcted in
LAN.
I want 1 PC to copy a batch\exe file to a remote PC and than run it.
thanks for the help. Tag: Save a encoded MS-Word document to a text file Tag: 208339
Problem w/ VBScript running against SQL Server 2000
I have been getting the following error when I run some VBScript code on an
ASP page that modifies values in a SQL Server 2000 database:
Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 3: Incorrect syntax near
','. /manProds.asp, line 185
POST Data:
bayID=105700112&bayName=Another+New+Test+Today&baycat=Laptops&baysubcat=Database+SW&bayPicture=Illustration+Not+Available&bayPrice=35.58&bayBriefDesc=another%0D%0A%09%09%09&bayFullDesc=Product+Descrip . . .
This same code worked fine w/ SQL7, but for some reason won't work w/
SQL2000. The code is as follows:
<%
IF addProduct <> "" THEN
sqlString = "INSERT INTO bayServ " &_
"( bay_name, bay_cat, bay_subcat, bay_picture, " &_
"bay_price, bay_briefDesc, " &_
"bay_fullDesc, bay_status ) VALUES ( " &_
" '" & fixQuotes( bayName ) & "', " &_
" '" & ( bayCat ) & "', " &_
" '" & ( baySubCat ) & "', " &_
" '" & fixQuotes( bayPicture ) & "', " &_
bayPrice & ", " &_
" '" & fixQuotes( bayBriefDesc ) & "', " &_
" '" & fixQuotes( bayFullDesc ) & "', " &_
bayStatus & " )"
bayDB.Execute sqlString
%>
...(redacted web code)
<%
END IF
IF updateProduct <> "" THEN
sqlString = "UPDATE bayServ SET " &_
"bay_name='" & fixQuotes( bayName ) & "'," &_
"bay_picture='" & fixQuotes( bayPicture ) & "'," &_
"bay_price=" & cCUR( bayPrice ) & "," &_
"bay_cat='" & fixQuotes( bayCat ) & "'," &_
"bay_subcat='" & fixQuotes( baySubCat ) & "'," &_
"bay_briefDesc='" & fixQuotes( bayBriefDesc ) & "'," &_
"bay_fullDesc='" & fixQuotes( bayFullDesc ) & "'," &_
"bay_status=" & bayStatus &_
"WHERE bay_id=" & bayID
bayDB.Execute sqlString
%>
The last bayDB.execute.sqlString is line 185. I've included the addProduct
snippet because it works just fine, but maybe the problem is passed from
there--I don't know. From what the error notes, I'm guessing the problem
might be w/ the variable bayPrice, which is defined as type 'money.' But
everything I've done to try to fix it returns the same error. The post data
string suggests it might be a problem w/ bayBriefDesc, but I can't see any
problem w/ how I have it set up in the code (and after all, it works fine in
fine in addProduct). The FixQuotes function is as follows:
FUNCTION fixQuotes( theString )
fixQuotes = REPLACE( theString, "'", "''" )
END FUNCTION
I can't figure out what exactly the problem is, and would much appreciate it
if someone could review my code and let me know what I might have done wrong
or what I could possibly do to fix it. TIA...
ba Tag: Save a encoded MS-Word document to a text file Tag: 208327
Enabling Delegated Authentication
Hi,
I am trying to install printer to a remote machine using vbs scripts. I can
install on local machine, but not on remote machine under domain setting.
Here is my script:
cscript prndrvr.vbs -a -m "HP LaserJet 4240 PCL 6" -s hptest.domain.com -h
"C:\HP4240\english\Drivers\Win32_2000_XP_S2003\PCL6" -i
"C:\HP4240\english\Drivers\Win32_2000_XP_S2003\PCL6\hpc4x50c.inf" - username
-w pwd
I get the following error messsage:
Unable to add printer driver HP LaserJet 4240 PCL 6 Win32 error code 87
Alan from Microsoft says it has to do with "Enabling Delegated
Authentication". If I delegate using GPO, it might compromise our network
security since the delegation is also for a computer account. I've read
another article to "Enable Constrained Delegation" which may work better.
However, which services do we add to be trusted for delegation for me to
install printer on remote machine? Any suggestions or comments greatly
appreciated. Thanks! Tag: Save a encoded MS-Word document to a text file Tag: 208322
Outlook-Script which reads E-Mail Header and put it into a new email
Dear guys,
Is it possible, to build a script for MS Outlook (2003), which reads the
E-Mail Sender, Subject and Time-Stamp from any E-Mail which comes in, and
forward it automatically as an Text-Email to another E-Mail address (this
address reads the text and send it via SMS, but this part is tested and
working)?
Best Regards
Wolfgang Bauer Tag: Save a encoded MS-Word document to a text file Tag: 208320
Determing if something is plugged into a com port.
I am trying to access a com port through vbscript. All I need to do is
verify that something is plugged into the com port- the only thing
that will be plugged in is a handheld barcode scanner. I don't have
mscomm licensing so I would prefer to not have to go down that route.
Any help at all would be great... code examples would be stupdendous!
Thanks.
-James Tag: Save a encoded MS-Word document to a text file Tag: 208317
combining isMember and next available drive
This is getting a bit complex for me (I think). I'm trying to incorporate a
section in my logon script that will determine which department(s) (i.e.
global groups; math, social, science, English...) a user is a member of and
will then map the S drive to that department's share. The initial drive
letter needs to be S. And if users are a member of 2 or 3 departments, they
may recieve a T and U drive too. Below is my code for the 'map the next
available drive' part. Then I try to add the isMember part and I'm getting
a bit confused (or maybe timid is a better word!) Would my best route be to
add a 'for each loop' that surronds the 'next available drive' code. And
loop would enumerate if the user was a member of each group listed in the
'for each loop' and assign a drive accordingly?
CODE
___________________________________________________
'Map S (departmental) drives
'Will also get a T drive if they're a member of 2 departments
'Will also get a U drive if they're a member of 3 departments
objNetwork.RemoveNetworkDrive "S:"
objNetwork.RemoveNetworkDrive "T:"
objNetwork.RemoveNetworkDrive "U:"
' This sections creates two objects:
' objShell and objNetwork and then counts the drives
Set objShell = CreateObject("WScript.Shell")
Set objNetwork = CreateObject("WScript.Network")
Set CheckDrive = objNetwork.EnumNetworkDrives()
' This section operates the For ... Next loop
' See how it compares the enumerated drive letters
' With strDriveLetter
On Error Resume Next
DriveExists = False
' Sets the Outer loop to check for 3 letters in strAlpha
For intCount = 1 To 3
DriveExists = False
' CheckDrive compares each Enumerated network drive
' with the proposed drive letter held by strDriveLetter
For intDrive = 0 To CheckDrive.Count - 1 Step 2
If CheckDrive.Item(intDrive) = strDriveLetter _
Then DriveExists = True
Next
intAlpha = intAlpha + 1
' Logic section if strDriveLetter does not = DriveExist
' Then go ahead and map the drive
If DriveExists = False Then objNetwork.MapNetworkDrive strDriveLetter,
strRemotePath
' Appends a colon to drive letter. 1 means number of letters
strDriveLetter = Mid(strAlpha, intAlpha,1) & ":"
' If the DriveExists, then it is necessary to
' reset the variable from true --> false for next test loop
If DriveExists = True Then DriveExists = False
Next Tag: Save a encoded MS-Word document to a text file Tag: 208315
Constrain TABLE elements dimentions.
I'm trying to organise the content on a web page as a table in 3 rows.
1st row and 3rd row = header and footer should always be visible.
2nd row (this is where the entire web-page content will be) should have
scrollbars displayed when needed. The BODY of the HTML page should not have
any scrollbars.
The following code works in InternetExplorer 7 exactly as I wanted. But in
Firefox 2, the scrollbars are displayed in the page BODY, instead of the DIV
element. How do I constrain the size of that TABLE and the DIV inside it? I
want to force Firefox to display the scrollbars in the DIV, and not in the
BODY?
<table style="height:100%; width:100%; table-layout:fixed;">
<tr style="height:24px;">
<td style="background-color:Gray;">
header
</td>
</tr>
<tr>
<td>
<div style="overflow:auto; height:100%; width:100%;
background-color:Orange;">
content<br />content<br />content<br />content<br />
content<br />content<br />content<br />content<br />
content<br />content<br />content<br />content<br />
content<br />content<br />content<br />content<br />
content<br />content<br />content<br />content<br />
content<br />content<br />content<br />content<br />
content<br />content<br />content<br />content<br />
content<br />content<br />content<br />content<br />
content<br />content<br />content<br />content<br />
content<br />content<br />content<br />content<br />
content<br />content<br />content<br />content<br />
</div>
</td>
</tr>
<tr style="height:24px;">
<td style="background-color:Gray;">
footer
</td>
</tr>
</table>
Thank You for any links and examples!
Or if there's a better news group for that question, please let me know!
George Valkov Tag: Save a encoded MS-Word document to a text file Tag: 208309
What MS operating systems have VBS installed?
I have a couple of VBS scripts that I'd like to share with others on
my web site. I'm putting together some instructions for their use and
realize that I don't know which MS OSs have the necessary scripting
engine in place by default.
I've only ever developed with VBScript on Windows XP Pro, so that's
the only platform I know for certain includes it.
Can anyone help me out? Thanks. Tag: Save a encoded MS-Word document to a text file Tag: 208307
verify users in XL spreadsheet exist in AD
Hi,
I have a spreadsheet where I want to search against the AD to verify if
users exist in the AD.
I have used the "set objRecordSet = obcommand.Execute" but that only return
all of the users it could find from my search string but it does not return
the failed search users.
Can I use objcommand.properties("Cache Results") = True and list the results
that way?
Thanks,
NT Tag: Save a encoded MS-Word document to a text file Tag: 208299
Why is this file copy/delete code failing?
Below is VBS code to copy a file from one folder to another, and then delete
it. I've stripped it out of a larger function just to isolate the problem
pieces. The folders are referenced in UNC format because the longer-term
goal is to use it across the network.
If I run it from scratch, the file copy works fine, but the file delete
fails. If I then run the script again, the file copy fails. It seems the
file copy will only succeed if the file doesn't already exist in the target
folder, so it would sound like a permissions issue. However, I have full
Change permissions on both source and destination folders, and if I attempt
the same thing from the same command line using DOS, it succeeds. Anyone
have a pointer as to what I might be doing wrong? Thanks.
If you try to run this yourself, change the sSourcePath and sResultsFN
values in the main script, and the oFolder path value in the Function to
something that will work on your computer.
Option Explicit
Dim sTargetPC, oNet, oFSO, oShell
Public sSourcePath, sResultsFN
sSourcePath = "\\127.0.0.1\d$\work\Temp\"
sResultsFN = "Results!.txt"
Set oNet = CreateObject("WScript.Network")
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")
sTargetPC = "127.0.0.1"
Call subDeleteTempFiles(sTargetPC)
Sub subDeleteTempFiles(sComputer)
Dim oFSO1, oFolder
Set oFSO1 = WScript.CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO1.GetFolder("\\" & sComputer & "\d$\Work")
On Error Resume Next
oFSO1.CopyFile sSourcePath & sResultsFN, oFolder.Path & "\"
If Err.Number <> 0 Then
MsgBox Now & vbTab & "Halt: Can't copy " & sSourcePath & sResultsFN & "
to " & oFolder.Path
WScript.Quit
Else
Err.Clear
msgbox "File should be copied now."
End If
On Error Resume Next
oFSO1.DeleteFile(oFolder.Path & "\" & sResultsFN)
If Err.Number <> 0 Then
MsgBox Now & vbTab & "Halt: Cannot delete " & oFolder.Path & "\" &
sResultsFN
WScript.Quit
Else
Err.Clear
msgbox "File should be gone now."
End If
End Sub Tag: Save a encoded MS-Word document to a text file Tag: 208293
Need reference for Excel object functions
Hello,
I'm trying to incorporate an Excel object into my script and need a
reference for the available functions. Thus far I have not been able to find
a comprehensive reference. I have found a few samples here and there, but I
need more. In a nutshell I need to do the 4 steps below and need help with
#1 and #4. Thanks.
1. Create a new Excel workbook. << How do I do this?
2. Add data to it.
3. Sort the data in descending order by A1.
4. Save the workbook. << How do I do this?
--
Regards,
Martin X.
MCSA: M Tag: Save a encoded MS-Word document to a text file Tag: 208290
Hide UNC in path under mapped drive?
I want to map my users directly to a folder within in a shared folder and
hide the unc path on the drive mapping under my computer.
Can anyone tell me how to do that? Tag: Save a encoded MS-Word document to a text file Tag: 208283
wmi or vbscript help
Hi, I'm not a coder by any means, but I'm slightly wet behind the ears.
What I'm looking to do is the following:
I am responsible for imaging several desktop and laptop computers in our
school district, and one of the mundane tasks I must do after each machine
has been imaged is to remove the 2 checkmarks under startup and recovery
options in windows xp (time to display list of operating systems and time to
display list of recovery options...) It get's to be a hassle to do this
every time I image a machine, and was hoping that this could be done via a
script. Unfortunately, I've not been able to find any info on how to do
this with either wmi or vbscript. I was able to find info on setting the
timeout, but I really need to be able to disable both of these options
alltogether.
So, any ideas, sample scripts, things to look for, etc???
Thanks,
Doug Tag: Save a encoded MS-Word document to a text file Tag: 208272
problems delete files and folders from desktop for domain user
We have a script that will delete files and folders from the desktop
on login. However, the users logging in have their profiles as
user.domain and not user so when the script runs it is deleting things
from c:\documents and settings\user\desktop instead of c:\documents
and settings\user.domain\desktop. I forget what to add. Part of the
script is below. Thanks.
strDesktop = objWSH.ExpandEnvironmentStrings("%UserProfile%\desktop\")
'*******Delete Files and Folders from desktop*******
Set Shell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
DesktopPath = Shell.SpecialFolders("Desktop")
objFSO.DeleteFile (DesktopPath & "*.*")
objFSO.DeleteFile(strDesktop & "*.*")
objFSO.DeleteFolder(strDesktop & "*.*") Tag: Save a encoded MS-Word document to a text file Tag: 208270
Global module limit of size of text?
I have a process that combines many vb functions into a single String
object.
This is then added to the VBScript control via the AddCode method.
Implicitily this becomes part of the global module.
When the script runs i start to get errors - because some of the
functions are missing.
This happens when the text reaches a certain limit.
So is there a limit on the text that you can add to the global module?
How can i resolve this problem?
Thanks. Tag: Save a encoded MS-Word document to a text file Tag: 208269
Disable Start Button
Hi all. I am trying to lock down computers for certain users for
security reasons. Is there a way that i can disable to start button at
logon without having to then reboot the computer. Everything I have
found says that it only works after I have logged in, then off and
then logged back in again. I would like to disable the start button
using VBS.
Any help in this matter would be highly appreciated.
Thank you Tag: Save a encoded MS-Word document to a text file Tag: 208268
Two CSV file data to new excel file
I am having two CSV files. I need to generate new excel file while
running VBSCRIPT. That newly generated excel file sheet1 data should
be first csv file data and the same file sheet2 data should be second
csv file data.Newly generated excel file sheet1 name should be name of
the first csv file and the same file sheet2 name should be name of
the second csv file.I need only in VBSCRIPT not in VBA
Thanks in advance for your help Tag: Save a encoded MS-Word document to a text file Tag: 208264
Re: placing computers OUs depending on where the user is
Hi,
I am looking for a script that will move computers to a OU depending
on where the user is place in AD.
For example, if a user is in OU=IT,DC=TEST,DC=COM I would like to
computer to be placed in that container or even better a container
underneath
ie OU=ITCOMPUTERS,DC=TEST,DC=COM
I was hoping this could be done via a vbscript
TIA
Oli Tag: Save a encoded MS-Word document to a text file Tag: 208255
Monitoring script for run away processes
I have a need to create a script that will create an event log entry on the
local machine for any process that starts with nv* and has been running over
20 hours?
Does anyone have and idea on how to complete this?
--
Nick Tag: Save a encoded MS-Word document to a text file Tag: 208254
Document conversion
Hello all.
I have an exchange 2003 environment with over 300 user accounts.
When we get a new user, I create an HTM signature file, open it in
word, save it as RTF and then save as TXT. These files are put in a
folder on a network share named the same thing as the user's
username.
For example, the user's name is john smith. On the network share,
would be a folder called jsmith, and within that folder would be 3
files, signature.htm, signature.rtf and signature.txt.
During the login, the login script takes these files and Xcopies them
into the signatures folder in the user's profile. I then have a VBS
script (courtesy of Sue Mosher, microsoft MVP) that sets this
signature file as the current signature.
My problem is this... I do not want to have to OPEN the HTM file to
create the RTF and the TXT. I COULD create the rtf simply by doing an
xcopy "path\sig.htm path\sig.rtf" and that works fine. Trouble is when
creating the TXT, ALL the html code becomes visible.
Is it possible at all to do this via VB script?
Thanks in advance. Tag: Save a encoded MS-Word document to a text file Tag: 208253
update today's date in a folder name, daily, via a script?
JustSomeGuy <JustSomeGuy@discussions.microsoft.com> wrote:
Looking for a way to have a folder whose name goes like this:
"Today is July 19, 2007"
and the date dynamically updates daily so it's always the correct day.
could this be simply done in a script that runs daily at some given time and
renames the folder?
> Is there a way to embed today's date in a folder name so that every
> day, the folder name always shows the correct date for that day?
>>I imagine you could write a script to regularly rename that folder, but that
>>isn't my area of expertise. Try posting in
>>microsoft.public.windows.scripting for more expert help. Tag: Save a encoded MS-Word document to a text file Tag: 208252
Setting screensavetimeout via registry and getting it to take effect immediately
So I've seen a few posts on this topic, however nothing offering a
solid conclusion. I'm writing a script that is set to run on login
that resets the screensaver settings to a default setting, most
importantly overwriting the timeout to 10 minutes regardless of what
it is set to. I have a script that does that fine, the only problem
is that once the script runs, the machine needs to be rebooted again
for the change to be updated in the display properties. Some people
have said that i need to run user32.dll, updateperusersystemparameters
in order to fix the problem, however that doesnt' seem to work for
me. Surely there has to be some way of getting this done. Does
anyone have any suggestions? Here is my current script:
Set oShell = CreateObject("WScript.Shell")
oShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveTimeOut", "600"
oShell.run "c:\windows\System32\RUNDLL32.EXE
user32.dll,UpdatePerUserSystemParameters", 1, True
Others have said to do some type of API call, however i can't seem to
find any type of example for that. Tag: Save a encoded MS-Word document to a text file Tag: 208250
Writing my 1st VBS "Script Component"
I am writing my furst VBS "Script Component" -- I have a bunch of VBScript
code for implementing websites and web-based applications on IIS/ASP. I was
thinking "Script Components" looked like a way to compact some of these
resources -- at least maybe cut down on the includes I am doing with my asp
files.
For example, I have a VBScript class in an asp file. Using the Script
Component Wizard, I created a typelib file and a wsc file that describe the
properties and methods of my VBS Class. Now, I'm supposed to put the VBS
code into the wsc "envelope" created by the Wizard.
My [blatantly-newbie] questions are these:
(1) Do I include the "Class" and "End Class" statements in the wsc file
somewhere? I would think not because if it is in a wsc file it -IS- a class;
is it not?
(2) Will this code now run any faster? Why or why not? The code is not
used inside any loops or anything. (Actually, it uses CAPICOM.dll to encrypt
payment transactions to PayPal.)
(3) Should the typelib be declared in the Application Object (i.e., in the
global.asa file)? Or should I just splice the reference into each ASP file
that uses it?
(4) Should the object be instantiated in the Application object? When { is
this | is this not } a good idea?
(5) Should I implement the ASP interface within this Script Component (for
the purpose of accessing the IIS Objects)? As a convenience, I define
certain constants there which adapt the set of files (i.e., the website) to
the configurations of different servers (e.g., data sources, smtp and pop3
addresses, things like that). But it's not that important. I suppose the
answer has something to do with server farms, loadsharing, and the scope of
ASP Objects. Any remarks?
Thanks for your kind assistance.
Jim Rodgers
------------
COMMENT: You know, it's kind of cool that such an often-disregarded
language (which I love anyway) can have classes, including enumerated
constants and all that jazz. The resonance among my VBA, VB6, and VBScript
code libraries is just amazing! Thank God for ten solid years of ASP
Classic, the MS Office Macro recorder, and IntelliSense! Tag: Save a encoded MS-Word document to a text file Tag: 208248
Is there any sample vbscript for saving a encoded MS-Word document to a text
file