Crystal Reports + ASP
i'm a new ASP learner and is doing my report section of
the project system. anyone out there who knows about using
Crystal Reports with active server pages? I would really
appreciate it if someone could tell me what to do as I'm
out of options.
Thank you. Tag: write to excel Tag: 143158
delete group member ship
is there a way to delete the group from a users ( member
of ) attribute. I have users who already have some
distribution groups defined, is there a way that i can get
red of it and get it new ones there.
thanks Tag: write to excel Tag: 143154
vb scripting on win 2003?
Hello!
I am trying to run a vbscript that performs a reboot on a windows 2003
server.
This script has worked well in windows 2000, but now it quits with
complaints about rights.
=================================
The script:
Dim oShutdown, oOPSys
Set oShutdown =
GetObject("winmgmts:{impersonationlevel=impersonate,(RemoteShutdown)}\\192.1
68.25.254").Execquery("Select * From win32_operatingsystem")
For Each oOPsys In oShutdown
oOPsys.win32shutdown(2+4)
Next
=================================
Do i have to make some other system call to perform a reboot on
a windows 2003 server?
Thanks for listening...
Br,
Christian O.
chot@home.se Tag: write to excel Tag: 143151
oNetwork Functions?
Hi,
Does anyone have a list of all the oNetwork. I.e.
oNetwork.AddWindowsPrinterConnection, oNetwork.SetDefaultPrinter etc
Is there a way to delete all current Windows printers? Maybe something like
oNetwork.DeleteWindowsPrinterConnection
Cheers
Ben Tag: write to excel Tag: 143149
Event ID 1000: Attempt to execute Windows Script Host while it is disabled.
This is a multi-part message in MIME format.
------=_NextPart_000_00E5_01C37D14.FD122AB0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
I'm trying to get a startup script going on Windows NT. I tried running =
the script as a service and I tried using XGina (3rd party tool that =
allows running startup/shutdown scripts on Windows NT). Both give the =
same results in the Event Log:
Attempt to execute Windows Script Host while it is disabled, Event ID =
1000
The script runs like a charm when you run it manually after you have =
logged on, but something is blocking wscript.exe to run before login.
Anyone knows how I can fix this?
Kind regards,
Vincent Timmermans
------=_NextPart_000_00E5_01C37D14.FD122AB0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2722.900" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I'm trying to get a startup script =
going on Windows=20
NT. I tried running the script as a service and I tried using XGina (3rd =
party=20
tool that allows running startup/shutdown scripts on Windows NT). Both =
give the=20
same results in the Event Log:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>Attempt to execute Windows =
Script Host=20
while it is disabled, Event ID 1000</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The script runs like a charm when you =
run it=20
manually after you have logged on, but something is blocking wscript.exe =
to run=20
before login.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Anyone knows how I can fix =
this?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Kind regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Vincent =
Timmermans</FONT></DIV></BODY></HTML>
------=_NextPart_000_00E5_01C37D14.FD122AB0-- Tag: write to excel Tag: 143148
vbEmpty error?
Hi,
I'm programming a logon script to map to a printer, I got this script out of
a windows 2000 scripting book so it should work. However I receive: - Error:
Object required: 'vbEmpty' Code: 800A01A8.
The book just says that its releasing the memory required for those
variables.
Option Explicit
Dim oNetwork, sPrintPath
Set oNetwork = CreateObject("WScript.Network")
sPrintPath = "\\PRINTSERVER-2K\ORG_FS-7000"
oNetwork.AddWindowsPrinterConnection sPrintPath
oNetwork.SetDefaultPrinter sPrintPath
Set oNetwork = vbEmpty
Set sPrintPath = vbEmpty
Anyone see anything wrong?
Cheers
Ben Tag: write to excel Tag: 143145
RegRead Syntax
Hi,
I'm looking for the good syntax to read a Reg Key like this :
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices]
"\\\\Server\\Printer"="winspool,Ne01:"
I try :
Set Sh = WScript.CreateObject("WScript.Shell")
WScript.Echo Sh.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows
NT\CurrentVersion\Devices\" & "\\\\Server\\Printer" )
but i get an error message.
What is the correct syntax for this Reg Key in vbscript ?
Thank you
--
Guy Roussin Tag: write to excel Tag: 143144
automatic login and computer lock
Hi,
I have a problem on a machine which is running 24h a day. On the machine are
running my own scripts which have to reboot the machine somtimes and restart
my scripts in an active domainuser enviroment (active use of a
server-database).
I want to solve the problem as script in the following steps:
- reboot the machine automaticly (it's no problem)
- automatic login as specified domain-user
- and as a security reason locking the machine with the actual domain-user
(Lock_Computer)
Can everybody help me or give me some tips where I can find a solution or is
there anywhere a software available outside the scripting world?
Thanks for everybodies help and have a nice day.
AlexanderS Tag: write to excel Tag: 143143
Data Access Question
Dear All
I have created a calendar asp page using vbScript that
loads data from a SQL database. It highlights the date I
have data. Everything works well, however I have one
question about the data access procedure and one about
erasing the array.
I load the data for the current month into an array after
opening a connection with the database and then close the
connection. If the user then selects the next month,
another connection is opened and the values loaded into an
array. Like above the connection is closed. Is this the
best way to approach it when I will have hundreds of users
accessing the SQL Server database at the same time?
Current Month >> Opens connection >> Fills Array >>
Displays results >> Closes Connection.
Next Month >> Opens connection >> Fills Array >> Displays
results >> Closes Connection.
If I create the connection to the database and fill the
array with data in the Header of the HTML page and display
the contents of the array in the Body of the page, where
do I erase the array, or do I even need to?
Thanks again and I appreciate your help.
Alastair MacFarlane Tag: write to excel Tag: 143142
Data Access/ASP question
Dear All
I have created a calendar asp page using vbScript that
loads data from a SQL database. It highlights the date I
have data. Everything works well, however I have one
question about the data access procedure and one about
erasing the array.
I load the data for the current month into an array after
opening a connection with the database and then close the
connection. If the user then selects the next month,
another connection is opened and the values loaded into an
array. Like above the connection is closed. Is this the
best way to approach it when I will have hundreds of users
accessing the SQL Server database at the same time?
Current Month >> Opens connection >> Fills Array >>
Displays results >> Closes Connection.
Next Month >> Opens connection >> Fills Array >> Displays
results >> Closes Connection.
If I create the connection to the database and fill the
array with data in the Header of the HTML page and display
the contents of the array in the Body of the page, where
do I erase the array, or do I even need to?
Thanks again and I appreciate your help.
Alastair MacFarlane Tag: write to excel Tag: 143141
Renaming local user in Windows 2000
Hi
I would like to change the name of severel but not all
users in a lot of windows 2000 servers. Does anybody know
how to do this with scripting. Or any other way as well?
Best Regards Henrik Alstsrsjo Tag: write to excel Tag: 143140
Submit a part of page
In my page i have two list box and other information. On change of the first
listbox i want to refresh the values in the second listbox from the
database. I would not like to submit the whole page. Is there any way to
submit just a part of page. I would also not prefer using frames.
Thanks. Tag: write to excel Tag: 143139
Stumped !!
Hello,
I need to create a couple scheduled tasks on +515 W2K DCs that are located in
many different time zones. I can create the tasks this way:
'(Using hard coded time)
'********************************************************
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewJob = objWMIService.Get("Win32_ScheduledJob")
ShutdownJobCreated = objNewJob.Create ("Notepad.exe",_
& "********180000.000000-300", False , , , , JobID)
'********************************************************
I cannot create the task this way:
'********************************************************
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colTimeZone = objWMIService.ExecQuery ("Select * from Win32_TimeZone")
For Each objTimeZone In colTimeZone
If objTimeZone.DayLightBias = 0 Then
If objTimeZone.Bias >= 0 Then
objTZoffsetMinutes = "+" & objTimeZone.Bias
Elseif objTimeZone.Bias < 0 Then
objTZoffsetMinutes = objTimeZone.Bias
End If
Else
If objTimeZone.Bias = 0 Then
objTZoffsetMinutes = "+" & (objTimeZone.Bias)
Elseif objTimeZone.Bias >0 Then
objTZoffsetMinutes = "+" & (objTimeZone.Bias - 60)
Elseif objTimeZone.Bias < 0 Then
objTZoffsetMinutes = (objTimeZone.Bias + 60)
End If
End If
Next
Set objWMIService = GetObject("winmgmts:" _ &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objShutdownJob = objWMIService.Get("Win32_ScheduledJob")
shutdownJobToCreate = objShutdownJob.Create _
& ("Shutdown.exe", "********1800000.000000" & objTZoffsetMinutes, _
& False , , , , JobID)
Wscript.Echo shutdownJobCreated
'***********************************************************
Variable replacement will not work - keep getting an error that a ")" was
expected.
Any suggestions will be greatly appreciated.
Thanks in advance,
Bill Burke
bill@2burkes.com Tag: write to excel Tag: 143126
Form data validation methods
Greetings. This post is related to my recent post, and
may better explain what I am trying to do .... hopefully :-
)
Question, what is the most efficient way to validate data
in a form? For instance, I know I can do something like
this:
Function Form1_onSubmit()
If Form1.txtuser1.Value = "" Then
' do something here
End If
If Form1.txtuser2.Value = "" Then
' do something here
End If
End Function
However, what if I have several like fields, e.g.
txtuser1, txtuser2, txtuser3, etc. ... in that case the
above approach to data validation is not very efficient.
Especially when I want to run several like fields against
the same validation methods (i.e. is it blank, does it or
does it not contain this or that character?). To further
complicate matters, what if the amount of like fields I
have on my page will vary on each load because they are
created "dynamically" thru ASP code? In that case, there
is no way to setup the above, functional albeit
inefficient, method of validating my data. In a nutshell,
what I am trying to accomplish on the client-side is what
I can rather easily do on the server-side:
For x = 1 To Request.Form.count()
strFrmKey = Request.Form.key(x)
strFrmItm = Request.Form.item(x)
' Do whatever other checking I would like here
Next
Is there, or what is an equivalent for client-side
validation? Any and all answers are greatly appreciated.
Doug Tag: write to excel Tag: 143125
Iterate thru all elements in form
Hi,
Just wondering if there is a way to iterate thru all
elements in a form for the purpose of validating data on a
form.
What I would like to do is something like:
Set objElements = document.Form1.Elements
For Each objElement in objElements
If objElement.type = "text" AND objElement.name
= "txtUName" Then
'Do something here
End If
Next
The above does not seem to work. In fact the only thing
that I can get to work is this:
Set objElements = document.Form1.Elements
For Each objElement in objElements
MsgBox objElement
Next
The above only responds with several messages
containing "[object]" ... not very useful. Can anyone
shed some light on this? Thanks, Doug Tag: write to excel Tag: 143124
Reboot multiple CPs
Hi,
How can I reboot, multiple, remote PCs ( Windows2000 PCs ) using
input from a text file containing workstation number/name, of course
using a loop.
Before rebooting, I want to verify if the PCs is on by pinging it from
within the script.
Let me please know if there is a vb script available to perform the
above mentioned task.
Thanks Tag: write to excel Tag: 143122
How do I get the AD username for the current logged on user?
Does anyone know how to use vbs or wsh scripting to get the AD
username for the currently logged in user? What I am trying to do is
write a logon script that looks at the current user's group
memberships to map printers. I do not know how to retrieve the
username of the person that is logged in. I have the rest of the
script but with the username hard coded as seen below:
Set objUser = GetObject _
("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com")
Thanks,
Gary Tag: write to excel Tag: 143121
How to convert cmd to vbs
How do I convert this cmd file to a vbs file, any suggestions what to do,.
'All one line
C:\WINDOWS\system32\cscript.exe "c:\program
files\gpmc\scripts\BackupAllGPOs.wsf" "O:\GPO Policies\" DEVELOPMENT "GP
Backup"
Thanks Don Tag: write to excel Tag: 143120
OS SCRIPT
Could someone please help me(a non AppDev person) put a
script together that will determine OS type and then
execute a file germane to the result, that I could either
place in a login script or execute manually?
I.e.
WINNT = NT4.exe
WIN2KSRV = NT2KSRV.EXE
Thank you in advance,
Bart Tag: write to excel Tag: 143117
detemine local computername
hi,
i have a question,
iam making a logon script for laptop users (windows xp) on terminal server,
when there in the office they work on terminal service (citrix) and out of
the office they work local, when loggin on the citrix server we want to
determine the computername of he user to copy files to, how can we do this
with vbs script?
when i use this i get the computername of the server back,
sComputer = oNet.ComputerName
sAdsPath = "WinNT://" & sComputer & "/lanmanserver"
Set oAdsObj = GetObject(sAdsPath)
greets martijn Tag: write to excel Tag: 143106
Configuring addresses for users
Hello,
I have 150 users under single ou=employees, I need to configure a script so
that it would configure addresses for the users. Here is what I got so far:
Const ADS_PROPERTY_UPDATE = 2
Set objUser = GetObject _
("LDAP://cn=whatever,ou=employees,dc=test,dc=org")
objUser.Put "streetAddress", "999 test st"
objUser.Put "l", "Boston"
objUser.Put "st", "MA"
objUser.Put "postalCode", "11111"
objUser.Put "c", "US"
objUser.PutEx ADS_PROPERTY_UPDATE, _
"postOfficeBox", Array
objUser.SetInfo
But this only does for single user, I don't want to go to 150 users
properties and update manually or retype the script user name everytime.
Thank you
Eimis Tag: write to excel Tag: 143096
InStr function not working
Help!
I have a script here that will not work correctly
according to the InStrRev function rules. When it runs,
the file path comes out really weird. For example, the
path: "C:\Documents and Settings\user1\My
Mail\personal.pst" is coming back "gs\user1\my
mail\personal.pst" instead of just displaying the file
name "personal.pst" like it should. Can someone please
take a look? If you need the rest of the code, let me
know. Basically what I have is a list of file path names
in lstPSTList and I'm trying to trunkate the whole path so
I just get the file name.
strKeys = lstPSTList.Keys
For intPST = 0 To lstPSTList.Count - 1
strPSTFilePath = lstPSTList.Item(strKeys(intPST))
strPSTFile = Right(strPSTFilePath, InStrRev
(strPSTFilePath, "\"))
MsgBox strPSTFile
Next Tag: write to excel Tag: 143090
TDC Control and Colors
Hi
I'm using the TDC (Tabluar Data Control) to display computer system
information out of a text file. The first column contains the event type
(information, warning, error).
Is there a way to define a color (for the text or the cell) based on the
content (information, warning, error) in a TDC Control?
Many Thanks
Pius Tag: write to excel Tag: 143088
Updating DAT files with logon script
Hello,
How can I update new dat files for users with active directory group policy?
On winnt4 domain we just run .bat file and it calls for dat.exe file.
Maybe I can create logon script .vbs file to call silently for the new dat
file?
Thank you
Eimis Tag: write to excel Tag: 143084
looping
I am trying to figure out how to loop inside a script. I am using a .vbs
file where I set wshshell = wscript.createobject ("wscript.shell)
then I run the user32.dll lockworkstation.
I have used For i = 1 to 3
then the lockworkstion code
and then next.
The script will only run one time. Am I using the wrong syntax for
looping?
Thanks for your time. Tag: write to excel Tag: 143083
MSHTA - Logon Script
I'm using a logon script on a Novell network. This logon script calls a batch
file which, in turn, calls mshta with the parameter being the url to the asp.net
intranet web site. This works great on all machines (after numerous fixes and
tweaks to the hta). The only problems I have seen are, on Windows 2000 machines
that have IE 6.0 with no other updates to IE (via Windows Update), the hta hangs.
mshta.exe is still listed in the list of processes, but the hta never gets
displayed.
One of the August, 2003 updates from windows update fixes this problem, but we
can't depend on the users to do this to fix it (as they don't want this
application running anyways). None of the updates listed in August list anything
about HTA's or (afaik) script bugs (other than cross domain exploits that have
been fixed and aren't an issue here afaik).
So, any other ideas?
Thanks,
Mythran Tag: write to excel Tag: 143080
installing patch
i am trying to deploy Windows2000-KB824146-x86-ENU.exe using psexec in quite
mode.
i found a problem with the "-u -z" parameters, cos when i
execute c:/>psexec \\computername -i \\servername\dir1\patch.exe it runs
well.
any idea how to include "-u -z" to the command string? Tag: write to excel Tag: 143069
How to remove add-on from MSProject?
I've written an add-on to MSProject (dll). It adds some
buttons to toolbar in MSProject. When I unregister my
addon using regsvr32, buttons still remain on toolbar.
Is it possible to remove them programmatically?
Thanks in advance. Tag: write to excel Tag: 143066
Unicode to Ascii
I have a listbox which items I want to save in a textfile. This one must be
ascii but so far as I found out the list elements are all unicode. How can
I convert this Unicode ones into good old Ascii ones? I already tried
StrConv(...,vbFromUnicode) but there only my debugger strikes? What shall I
do?
thx 4 any hint
chris
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ Tag: write to excel Tag: 143065
manipulate binary structs/files
Hi group,
Is there a way to manipulate binary structs/files in JScript/VBscript.
I have in mind some components that would have methods like
var buf; // whatever bytearray variant or something more apporpriate
f.open(filename);
f.read(offset, buf, sizeof(buf));
b.scanf(buf, format= "%c[4]%d ....", v1, v2, ....);
b.printf(buf, format= "%c[4]%d ....", v1, v2, ....);
f.write(offset, buf, sizeof(buf));
Perl has pack()/unpack() functions that are very alike to the above ones.
Thanks!
George VS (gogovsh@abv.bg) Tag: write to excel Tag: 143063
Class in vbscript
Hi,
I'm going to develop a solution in vbscript and I have chosen to use
Class in vbscript, but my question is the following:
Is there any reason not to prefer Classes use instead of a basical
solutions (functions, etc..) ?
Thx for your time,
Vince. Tag: write to excel Tag: 143058
Help on copying
Hi all
I am trying to copy a file to %USERPROFILE%\start Menu\programs\startup
but the script cannot accept the path. Is there a way round this without
knowing the actual path??
Thanks Tag: write to excel Tag: 143050
Passing Dictionary object byref
Ive created an ASP class that uses a dictionary object which is filled from a recordset. It passes the object to the propterty of another ASP class byref:
Public Property Let dicReplaceVars(byref vdicReplaceVars)
set p_ReplaceVars = vdicReplaceVars
End Property
Private p_ReplaceVars
where it is used in this other class a few times to replace values in an array:
Function ReplaceVars(vArrayItem)
'' turn it into an array split at spaces
vArrayItem = split(vArrayItem," ")
'' loop through the array
for count = lbound(vArrayItem) to ubound(vArrayItem)
''See if it is a replacement variable and exists in the dictionary
if left(vArrayItem(count),6) = "tkRep_" and
p_ReplaceVars.exists(vArrayItem(count)) then
'' then replace it
Error occurs here >> vArrayItem(count) =
p_ReplaceVars.Item(cstr(vArrayItem(count)))
end if
next
dim vArrayItemNew
vArrayItemNew = ""
'' Loop through the array and put it back together
for count = lbound(vArrayItem) to ubound(vArrayItem)
if vArrayItem(count) = ubound(vArrayItem) then
vArrayItemNew = vArrayItemNew & vArrayItem(count)
else
vArrayItemNew = vArrayItemNew & vArrayItem(count) & " "
end if
next
'' return the vArrayItemNew to the function
ReplaceVars = vArrayItemNew
End Function
The error message I get is:
ADODB.Field (0x800A0D5C)
Object is no longer valid. D:\WWW\LCDEV\DOC_FUNCTIONS\../classes/classlcDocTKit_item.asp, line 52
However I have no idea why, it is a dictionary object and not a recordset, the object should still be open.
Any help is greatly appreciated.
Thanks
-----------------------------
This message is posted by http://Asp.ForumsZone.com Tag: write to excel Tag: 143045
HTTP_USER_AGENT and Safari/85 Problem
I am trying to include the following server variable in an
IF test: Request.ServerVariables("HTTP_USER_AGENT")
in my global.asa. Works fine in all browsers except
Safari/85. I get the following error:
---------------
Microsoft OLE DB Provider for ODBC Drivers
error '80040e57'
[Microsoft][ODBC SQL Server Driver][SQL Server]String or
binary data would be truncated.
-------------------
Any suggestions??
Thanks,
Dale Tag: write to excel Tag: 143043
Excel functions called from a web page?
Can you call Excel functions using VBScript on an ASP page? What/how do you
need to reference? I assume the server would need to have the MS extensions
loaded or something?
Thanks.
--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/reponse Tag: write to excel Tag: 143041
ASP submitting a form to 2 places on the same page
Ok,
have a normal html form that sends a username and password
to an asp page,
the asp page then retrieves the username and password and
puts it into cookies,
The page then uses a javascript submittal to a progress
database but this js is considered malicious code by some
browsers and will not work for certain users. So I have to
find a different way of gleaning the username and password
before it is sent off to the other page (which I have no
control over). I could always use a response.redirect but
then the username and password would be in clear text and
is unacceptable.
IS there anyway to do a blind submittal on an asp page
without user intervention??????? Tag: write to excel Tag: 143039
Help on script
Hi,
I''d like to create a vbs script that runs when a user logs in.
Basically, the scripts should query the users group membership and then run
a batch file stored on a server share.
If the user is not a member of the group then the batch file should not be
run
Any help will be appreciated.
TIA
LM Tag: write to excel Tag: 143037
RegExp: Password Validation
I am trying to create a regular expression pattern to
validate a user's password without any success. The
password must have the following characteristics:
- be at least 8 charachters
- must have both letters (both upper and lower) and numbers
It seems easy enough, but I am having a heck of a time
trying to create one. Any help would be greatly
appreciated. Thanks.
Greif Tag: write to excel Tag: 143031
Patchinst.vbs script
I am using this script to remotely install the patch. I don't know how to
use scripts and was looking for help. I changed the variable to not force a
reboot after patch is installed, but now I want to send a pop message to
that user using that same script stating that I installed a patch and they
need to reboot.
http://support.microsoft.com/default.aspx?scid=kb;[LN];827227
Thanks
Sal Tag: write to excel Tag: 143019
Excel, Value, and Arrays
The value property of a range object in excel has the
ability to return an array of values. While it works fine
in VB or VBA, I cannot get the following code to work in
a vbs file.
Dim aryData()
Set oRange = oExcel.Range("A5").CurrentRegion
aryData = oRange.Value
I get the error
Microsoft VBScript runtime error: Type mismatch
Any thoughts? Tag: write to excel Tag: 143012
Permission Denied when using OpenTextFile repeatedly, is it stepping on itself?
I've got a script that does a lot of writing to a log file so I can
track its progress. Here is the subroutine that I use:
Sub LogMain(S)
Dim F
set F = fso.opentextfile(CurrentPath & "\log.txt", 8, true)
F.writeline Now() & vbTab & S
F.close
set F = nothing
End Sub
So from within my script, I can just call:
LogMain "test entry"
The problem I'm seeing -- which never used to happen, but has been
happening quite a bit over the past month or so -- is that the script
will work fine for a while, but at some point it suddenly hits a
"permission denied" error on the line that calls OpenTextFile. It
will not happen at the same point in the script every time, so I'm
having a hard time reproducing the error.
I'm closing F and then setting it to Nothing before ending the sub, so
I would not expect there to be a conflict the next time I open the
file.
If I change the routine to look like this, it will work flawlessly:
Sub LogMain(S)
Dim F
set F = fso.opentextfile(CurrentPath & "\log.txt", 8, true)
F.writeline Now() & vbTab & S
F.close
set F = nothing
wscript.sleep 5 '<-- new line
End Sub
Is this just a case of the file not really being closed by the OS
before I try to open it again? I'm only seeing this happen on one
machine, so far. Tag: write to excel Tag: 143009
exchange scripting
I tried posting this message in the exchange2000.development group but got
no answer, perhaps someone here can help me. I'm putting together a script
to delete certain messages in our public folders, right now i have it
working fine based on keywords in the message's subject using
objMessage.subject property, what i want to know is what property can i use
to see the received date on it and delete based on that?
ex code:
for each folder in objSubFolders
if folder.name = "test folder" then
Set tempfolder = objSession.GetFolder(folder.id, objInfoStore2.id)
Set Allmessages = tempfolder.messages
for each Messageval in allmessages
if inStr(messageval.Subject,"keyword") then
messageval.delete()
end if
next
end if
Next
what i would like to have it do is something to the effect of (if one of you
can help me with the proper syntax):
if (inStr(messagval.Subject,"keyword")) OR (messageval.ReceivedDate <
oneMonthAgo)
messageval.delete()
end if
i'm not sure of the actual property or if there is another function of means
to find the received date to test.
any help would be appreciated
thanks
chris coho
ccoho@jrwald.com Tag: write to excel Tag: 143008
How to select folders (only folders, not files) in ASP pages?
Hi all,
Could anybody give me a hand on select folders in ASP
pages?
The situation is that I want to specify a folder to save
download files in my ASP page. I know how to browse a
file. However, what I want is just browse to folder
level, just like we select a dirctory for setup
application.
Thanks a lot. Tag: write to excel Tag: 143005
Script to create COM+ application
I'm trying to create an automation script for creating a
COM+ application. I not seen any examples on this anywhere
just looking for a sample. Thanks Tag: write to excel Tag: 143004
vbscript that moves files that are older than 3 days
I need a vbscript that moves files that are older than 3 days
I am having problems writing this script
I f someone could help I would appreciate it
Thanks
Earl L Tag: write to excel Tag: 143002
Running Script with Elevated Rights
I have a VB script which detects the OS version, installs the latest RPC
patch, and opens an IE window telling the user they have been updated and
need to re-boot the system to "activate" the patch. I am pushing this task
with SMS and all is fine.
The problem is I have a significant number of users who are not SMS clients
and do not have Admin Rights on the local machine. I am trying to get the
script to run with elevated rights when manually invoked by the user and
having no success (I want to email a link to the script which says "Click
here to update your system").
Anyone have any words of wisdom on this task? I appreciate any and all
comments (unless they are nasty).
Thanks,
Russ J Tag: write to excel Tag: 142999
Printer Help
I use a VBScript for each user in their login script that maps a
specific network printer in the room where they are logging in.
This script uses the computer name to determine the specific printer.
This script work with Windows 2000 pro, and XP Pro.
Here is the problem;
I have 4 users accounts that it will not work and I just
cant figure out why. It appears to be a permissions issue
when the login script runs and the script throws this error.
Cscript Error: Loading your settings failed. (Access is denied.)
I have deleted the 4 users and recreated them, still they fail.
I know this script works, other users it works fine under both OS's
My questions are what specific permissions are required to run a
vbscript? Is the script failing because the u ser doesnt have the
right permissions to run it? Or, is it failing to make the changes
that the script is trying to change? ( ie; add the network printer)
Here is a snippet of the script
Option Explicit
DIM RegEntry, ComputerName
RegEntry="HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName"
ComputerName = ReadRegValue(RegEntry)
if InStr(1,ucase(ComputerName),"xpfinal",vbTextCompare) > 0 then call
SetPrinter("\\XXXX\test-1")
if InStr(1,ucase(ComputerName),"ms-a3-",vbTextCompare) > 0 then call
SetPrinter("\\XXXX\Test-2")
if InStr(1,ucase(ComputerName),"ms-a4-",vbTextCompare) > 0 then call
SetPrinter("\\XXXX\Test -3")
'so on and so forth.
wscript.quit
' *** This subroutine installs and sets the default printer
Sub SetPrinter(ByVal PrinterPath)
DIM WshNetwork
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection(PrinterPath)
WshNetwork.SetDefaultPrinter Printerpath
end sub
' **** This function returns the data in the registry value
Function ReadRegValue(ByVal RegValue)
DIM WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
ReadRegValue=""
On Error Resume Next
ReadRegValue= WSHShell.RegRead(RegValue)
End Function
I call this script from the logon.bat for each user;
@echo off
Cscript %LOGONSERVER%\netlogon\roaming.vbs
net use g: \\XXXXX\XXXX
The printer configurations are properly setup on the server and the
shares are correctly named. I didn't assign any specific permissions
to the printer shares. They work for hundred of other accounts.
When the users that the script fails on, try to add the network
printer via the wizard this fails too.
HELP
Robert Tag: write to excel Tag: 142996
The name of cells are in A1 to K1,
Wenn I run my vbs, the data overwrite this cells, I would'
like that write in the second line (A2 to k xxxx)
thank's for Help
Post your relevant code if you'd like someone to modify it.
Ray at work
"Juillerat Roland" <juilleratr@fr.ch> wrote in message
news:0bf001c37d1d$b6994f10$a401280a@phx.gbl...
> The name of cells are in A1 to K1,
> Wenn I run my vbs, the data overwrite this cells, I would'
> like that write in the second line (A2 to k xxxx)
> thank's for Help
>