Datetime with vbscript?
Hi:
There is a datetime field in a SQL Server database. Using ADO, I
extract the maximum date as follows:
strSQL = "SELECT MAX([Timestamp]) AS MaxDate FROM " & TableName
which I then execute. I then set a variable to this value:
varMaxDate = objRS.Fields("MaxDate")
and then I use this to set a SQL Statement:
sSQLStatement = "SELECT * FROM " & TableName & " WHERE Timestamp >= '"
& _
varMaxDate & "'"
The problem is, the resulting SQL Statement is a date, not a datetime.
What is the best way to create a SQL Statement that uses a real
datetime. This SQL Statement is to be used in a SQL Server DTS package
as a query against a Sybase database via ODBC (I'm using VB Script in
an ActiveX Script Task). So my goal is to look in the target table (SQL
Server) for the maximum datetime, and then get any records in the
source (Sybase) with a datetime greater than what is in the SQL Server
database.
Thanks,
Kayda Tag: personal cert Tag: 173881
How to disable File and Print Sharing using VBScript
How do we disable File and Printer Sharing using VBScript for Windows 2003.
Is there any other automated way to get this done. Like a registry tweak?
I used Regmon to identify the changes in registry. But when I made the
changes in the registry, it wouldn't reflect in the Network Properties even
after a re-boot.
Any help is appreciated. Thanks. Tag: personal cert Tag: 173872
Dynamicaly resizing popup-windows
Hi!
I use a "popup"-window to display the contents in a stringvariable (strMsg):
Dim oPopUp
Set oPopUp = window.open("about:blank","",
"height=450,width=400,scrollbars=yes,status=no,toolbar=no,menubar=no,locatio
n=no")
With oPopUp.Document
.Open
.Write "" & strMsg & ""
.Close
End With
The problem is that I don't know in advance how much text oPopUp is to
display. The contents of strMsg varies considerably. Sometimes oPopUp ends
up with a lot of unused space and sometime the user has to scroll a lot.
Is there a way to determine how high oPopUp needs to be and thereafter
resizing the window before displaying it to the user?
TIA
PO Tag: personal cert Tag: 173869
Copying newerfiles and subfolders
Hi
Is it possible (how) to only copy newer files inclusive subfolderes using
VBScript?
Set FSO = CreateObject("Scripting.FileSystemObject")
I need this for the domain login script.
I there an easier way of doing this?
regards
Henry Tag: personal cert Tag: 173867
Need Script to add computer description from text file
Can anyone get me some sample code for a vb script to add a computer
description from a text file to Active Directory? Thanks, Rick Tag: personal cert Tag: 173865
InternalName
Does anyone know how I could echo back a internal name of an dll or exe
file? I found this link:
http://www.nedcomp.nl/support/origdocs/dotnetsdk/cpref/frlrfsystemdiagnosticsfileversioninfoclassinternalnametopic.htm
, but its for Visual Basic, C#, JScript only, and I can't figure out
how I would do it in vbscript. Tag: personal cert Tag: 173864
Please help with vbscript, Mysql, mysql control center & text field display on web page
hi,
I'm new to mysql & vbscript and am trying to figure out why I can query so
far almost all the information in my mysql database but can't figure out why
I can't query and display the information for a text field that has a lot of
text in it (several lines)?
using:
MyODBC-standard-3.51.9-win.exe
mysql-4.0.20d-win.zip (mysql 4.0.20d) just upgraded to
mysql-4.1.4-gamma-win.zip
mysqlcc-0.9.4-win32.zip (mysql control center)
Language="vbscript"
Software is of type varchar
Solution is of type text
if I write this, the information in Software is displayed on the web page
but if I try to do the same with the field Solution, nothing at all gets
displayed.
Response.Write "<TR><TD>Software: " & objRecSQL("Software") & "</TD></TR>"
Response.Write "<TR><TD>Solution: " & objRecSQL("Solution") & "</TD></TR>"
I think this one I get to see some of the information but not all of it as
if it's too long to fit, but I know it's there as I can see the entire
information directly in the mysql control center database.
Response.Write "<TR><TD>Solution: " & Request.QueryString("Solution") &
"</TD></TR>"
anyway I can see all of it or at least capture a line at a time so I can
display it on my webpage?
as you can see I'm extremly new at this and would appreciate any help at
all.
Thank You
France Tag: personal cert Tag: 173858
Read last lines of logfiel
Hello,
I want to make a script that reads 8 different logfiles and grep the
last 10 lines from those files (the result) and past that in a new txt
file.
Can someone point me in the right direction.
Thanx,
Marco Tag: personal cert Tag: 173853
Search or users in AD based on Groups
Hi
I quite new to VB scripts, and I have a slight challange on my hands. The
thing I want to do is something like this:
Search through AD for users and check group memberships
For all users in Group1
Print to file 1.txt
For all users in Group2
Print to file 2.txt
For all users in Group3
Print to file 3.txt
End script
As my knowledge in VB script is quite low, i would really appreciate if
someone could give me a hand here.
Regards
Frank G Tag: personal cert Tag: 173834
Text File Size Limit?
I'm using a script to get all of the shares of some servers on my network
and then write them to a text file. The script runs find until it gets to
one of either two servers that have hundreds of shares. The script will
crash. If I run each of these two servers in their own individual script,
they work okay. Is there some size limit to the file it can create? I'm a
bit of newbie here and appreciate any help. Here's the basis of my script
that uses the rmtshare command to get the shares. I reuse the code for each
server:
SET servername=server1
FOR /F "tokens=1 skip=4" %%i in ('rmtshare \\%servername%\ ^|findstr /L /V
"IPC$ ADMIN$ successfully." ^|findstr /B /I /V /C:"[A-Z][$]"') do (SET
Share=%%i) & (CALL :SecondTry)
FOR /F "tokens=1,*" %%i in ('rmtshare \\%servername%\%Share% ^|findstr /I
"Remark"') do (SET Remark=%%j)
IF "%Remark%"=="" FOR /F "tokens=2" %%i in ('rmtshare \\%servername%\%Share%
^|findstr /I "Path"') do echo \\%servername%\%Share%=%%i /unlimited>>
source.txt & GOTO :Last
FOR /F "tokens=2" %%i in ('rmtshare \\%servername%\%Share% ^|findstr /I
"Path"') do echo \\%servername%\%Share%=%%i /unlimited /remark:"%Remark:
=%">> source.txt
SET servername=server2
FOR /F "tokens=1 skip=4" %%i in ('rmtshare \\%servername%\ ^|findstr /L /V
"IPC$ ADMIN$ successfully." ^|findstr /B /I /V /C:"[A-Z][$]"') do (SET
Share=%%i) & (CALL :SecondTry)
:SecondTry
FOR /F "tokens=1,*" %%i in ('rmtshare \\%servername%\%Share% ^|findstr /I
"Remark"') do (SET Remark=%%j)
IF "%Remark%"=="" FOR /F "tokens=2" %%i in ('rmtshare \\%servername%\%Share%
^|findstr /I "Path"') do echo \\%servername%\%Share%=%%i /unlimited>>
source.txt & GOTO :Last
FOR /F "tokens=2" %%i in ('rmtshare \\%servername%\%Share% ^|findstr /I
"Path"') do echo \\%servername%\%Share%=%%i /unlimited /remark:"%Remark:
=%">> source.txt
:Last
GOTO :EOF Tag: personal cert Tag: 173831
Dynamicly propagating a List Box
I'm writing an HTA that does an LDAP query to find all computers in my AD
domain. Let's say the results are returned in an array called aryComputers
My goal is to take the output from the query and propagate a listbox in a
manor similar to the following:
HTML:
<select name="lstComputers" id="lstComputers">
<script language="VBScript">
<!--
for each computer in aryComputers
{code to propagate the listbox}
next
-->
</script>
Any pointers would be a big help!! Tag: personal cert Tag: 173823
How do I print multiple strings from an array in one window?
Ok I wanted to solve this on my own... however I am stuck. Here is the
code:
For i = 0 to RecordCount-1
PrinterName = PrinterNameField(i)
FinalName = PrinterName & VBCRLF & Printernamefield(i)
'MsgBox FinalName
Wscript.Echo PrinterNameField(i)
Next
What I have here is an array called PrinterNameField. It has a bunch
of printer names I got from a previous function. What I WANT to do is
print all the values from the array in one window, so it would look
like this:
printername1
printername2
etc...
However I can't figure out a way to make a string that will
automatically store this info so I can just "msgbox string" and get
this output. All I can do is get the outputs in their own window since
each loop prints it's own value.
Any help is GREATLY apprecieated.
thanks,
Thor Peterson Tag: personal cert Tag: 173821
Createing a directory on a remote computer
Is there a object or objects, available from WSH, that will allow me to
pass credentials and create a directory and set access permissions on a
remote computer? Tag: personal cert Tag: 173814
IADsTools
Hi, I've written a script to enumerate all the DCs in my domain (550
approx). Using the dcgetlist (I think thats it) operator in IADsTools, but
it only returns 300 DCs. There's definitely 550.
Is there an in built limit/bug in IADsTools?
Cheers, Seán Tag: personal cert Tag: 173811
Script to read text files and delete them if they do NOT...
Script to read text files and delete them if they do NOT contain the string 1.0
The script isn't done obviously but I can't get past the error msg:
45, 1) Microsoft VBScript runtime error: Invalid procedure call or argument
I'm a newbie so be gentle! Thanks!
Dim oFSO
Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")
Dim oGF
Set oGF = oFSO.GetFolder("G:\Scripts\SP")
Dim oTS
For Each oTF In oGF.Files
If LCase (Right(oTF.name,3)) = "txt" Then
oTS = oFSO.OpenTextFile("oTF.Files", ForReading)
End If
Next Tag: personal cert Tag: 173810
UDP connection via vbscript?
Hi all,
Can anyone tell me how i can make an UDP connection via vbscript?
I need to connect to a server, send a string, and get the returned info
in a variable. Then close the connection again.
I have been looking for a solution and havent yet been able to find one.
Thnx in advance for the help!!
Jelle Tag: personal cert Tag: 173809
Script Encoder .vbs
Anyone used Script Encoder for .vbs used in login
scripts ?
Client does not execute encoded .vbs
thanks
stephan Tag: personal cert Tag: 173807
install software on remote computer
I have to install some software on about 29 machines, I do not have access to
group policy. The script should create an output file to see if there's any
errors, like a log.
I also need an ini file which will be an answer file.
Question - How can I have an ini file if the app is already done. How will
the app know to look at the ini file.
I do not what you guys to make the script, I just what someone to point me
in the right direction, please
Thank you Tag: personal cert Tag: 173805
Remotely searching for files
I use the code below to query each sever, but I would love to run i
remotely and the result written to a log file. Any ideas?
===========================================================
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("C:\Winnt\system32\mcscan32.dll") and
objFSO.FileExists("C:\Winnt\system32\avparam.dll") then
set objFile = objFSO.GetFile("C:\Winnt\system32\mcscan32.dll")
Wscript.Echo "mcscan32.dll Date last Modified "
objFile.DatelastModified
set objFile
objFSO.GetFile("C:\Winnt\system32\avparam.dll")
Wscript.Echo "avparam.dll Date last Modified "
objFile.DatelastModified
ELSE
Wscript.Echo "Files do not exist."
End If
nnanna wrote:
> *I am a VB newbie. I need help with a script that will allow me quer
> a list of server (about 30) for two or more files and log the modifie
> times to a txt file.
-
nnann
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
----------------------------------------------------------------------- Tag: personal cert Tag: 173793
please help with recordset error
Hi, I have a web page that sends a starting date and an ending date to the same page when submit is clicked,
the dates are used in a string to execute a stored procedure and return a small resultset.
On the line where I validate whether the recordset is BOF or EOF I get this error:
ADODB Recordset Error
Operation is not allowed when the object is closed.
Even right after the line where I open the recordset I check its state and it says 0. I can't see what i'm
doing wrong. I thought maybe it was something to do with opening the results in the same page, so I created a
test page to send the results there, just to see if it would work, it still doesn't work however I get a
different error and it's on the line where I open the recordset:
ADODB Recordset Error
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
This is my code snip and some more explanation:
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open sConStr
If Request.QueryString("Action")="Go" Then
sStartDate = Request.QueryString("StartDate")
sEndDate = Request.QueryString("EndDate")
sExec = "Exec GetResults '" & sStartDate & "', '" & sEndDate & "'" '--WORKS WHEN PASTED IN QUERY ANALYZER
Set oResultsRs = Server.CreateObject("ADODB.Recordset")
oResultsRs.Open sExec, oConn '--ERRORS HERE WHEN ACTION GOES TO TEST PAGE
If Not(oResultsRs.BOF OR oResultsRs.EOF) Then%> '--ERRORS HERE WHEN ACTION GOES TO SAME PAGE
....the rest of the code builds the table, etc.
Any help would be appreciated - let me know if you need more info.
Thanks! Tag: personal cert Tag: 173792
Trim or chop sAMAccountName attribute to 20 Chars
Does anyone have an easy way to take an existing populated variable and trim
it or chop it to the 20 character limit for the sAMAccouontName attribute?
I searched here but didn't find anything that fit my needs...
--
Sean M. Loftus
Enterprise Architect
Loftus Consulting, Inc.
www.LoftusConsulting.com
sean(removeme)@loftus.org Tag: personal cert Tag: 173787
Windows 2003 User account tab, account options and values
Anyone have a list of the scriptable account options and values for this
tab?
There are 2 below that I use frequently, but I would like to use flags for
the 3 below:
"user cannot change password"
"password never expires"
"account is disabled"
------
'Enable the Users account
u.Put "userAccountControl",16
'Enable must change password @ logon flag on = 0, off = 1 if already set to
on
u.Put "pwdLastSet", 0 'Uncomment if passwords are required to be changed at
logon
-------
--
Sean M. Loftus
Enterprise Architect
Loftus Consulting, Inc.
www.LoftusConsulting.com
sean(removeme)@loftus.org Tag: personal cert Tag: 173786
Auto read email via vbscript
To all vbscript gods,
I have what seems to be a tough one, for me at least. Is it possible via a
vbscript to automatically login to say a hotmail.com, yahoo.com, google.com
or some other web mailbox, Outlook Express, or Outlook and read in the
contains of an email and then make a decision on it based on it's subject,
from address, and/or contents?
"Why in the hell would you want to do such a thing" you may be saying to
yourself. Well good question. I DON"T KNOW. No just kidding. I'd like to
develop an automated script that would perform an action on a server based
on the email it receives and the reading of the email is really my biggest
huddle.
Any pointers or help would be GREATLY APPRECIATED!!!!!
Thanks much,
Todd Tag: personal cert Tag: 173785
help needed parsing files
I have a txt file with data in the following format.
Name
Address
City, ST, Zip
Phone
Email
Notes
The fields are data only, I need to parse out the first 4 lines to a DB
or even csv/xls file. The data is seperated from the next record with
an empty line. Does anyone know a program or script that would
complete this task. There are about 50,000 records, any help is
greatly appreciated.
Chris at gmail dot com Tag: personal cert Tag: 173784
Retrieving Hard Drive Serial Numbers
I've got this script which works fine for IDE Hard Drives in WinXP:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
str = ""
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMedia",
"WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)
str = "Win32_PhysicalMedia" & vbCrlf
For Each objItem In colItems
str = str & "SerialNumber: " & objItem.SerialNumber & vbCrlf & vbCrlf
next
msgbox str
But tried this script on a Samsung 160GB SATA drive and it doesn't work.
Does anyone know of one that will work?
Thanks in advance. Tag: personal cert Tag: 173783
Losing Value Refresh
I have a popup screen that sends values back to a main web page using
the following vbscript code
window.opener.document.all.VIN.value=form1.VIN.value
this works fine my problem is that when i submit my main page and i
get an error - my VIN text box gets cleared and the user has to retype
all the information in the popup again. I have tried to set cookies on
the popup screen but it will not let me use the response.cookies
method to set their value on my popup screen. I thought i should be
able to do by using client side as well as server side vbscript ??
Can anyone help me solve my issue ??
thanks in advance
CG Tag: personal cert Tag: 173782
Scripting Exchange
I need a script to run against an Exchange 2000 server. I need it to report
information that would report back on the different folders their size and
number of items in the folders.
Haven't found anythhing
Thanks
Dante Tag: personal cert Tag: 173775
Mid doesn't work
hi friends, I'm trying to do this:
posini=1
for x=0 to 12
lon = breaks(x)-posini
valores(x)= mid(datos,posini,lon)
posini=breaks(x)+1
Response.Write "<br>" & valores(x)
next
datos contain something like "10|4|5|12|9|7|11|..." and the array breaks has
the position of the "|" character in the "datos" string...
I'm receiving this error (in spanish):
Tipo de error:
Error de Microsoft VBScript en tiempo de ejecución (0x800A0005)
Argumento o llamada a procedimiento no válidos: 'mid'
/intranet/rpigroom/create_chart_year.asp, lÃnea 39
Why "mid" is not working? Do you have any idea? thanks a lot Tag: personal cert Tag: 173771
robocopy do not write log files to UNc path
I'm trying to write a script that copy same files from Server1 to Clients
during Logon.
Every thing goes fine. The files copied but the problem i donot see any log
files. Tey will not be created. Wenn i run script localy from client, then
the log files created.
Can anybody help me??
Sorry for bad English Tag: personal cert Tag: 173765
Delete Desktop Icon
Hi,
I am wondering if one if you kind souls could write me a very simple script
that I can use as a startup script on a domain to delete desktop icons in
the All Users local profile
Thanks
David Tag: personal cert Tag: 173759
trying to modify a multivalued string attribute of AD object.
I am trying to delete some specific types of proxy addresses and the script
does not quite do it. I can connect to the object and copy the addresses to a
log file but no deletion.
Dim oUser, strLogFile, strUserDN, objUser, proxy1
Const ADS_Property_DELETE = 4
oUser "LDAP://CN=smith\,Jon,OU=Users,OU=company,DC=domain,DC=co,DC=uk"
Set objUser = GetObject(oUser)
strLogFile = "C:\scripts\" & objUser.cn & ".txt" 'output file For recording
addresses that have been deleted
Set oFSO = WScript.createObject("scripting.FileSystemObject")
Set WFile = oFSO.CreateTextFile(strLogFile, True)
WScript.Echo "running script"
wfile.WriteLine "User Name" & oUser
For Each entry in objUser.GetEx("proxyAddresses")
proxy1 = entry
If Left(proxy1, 4) = "rfax" Then
wfile.WriteLine proxy1
objUser.PutEx ADS_Property_DELETE, "proxyAddresses", Array(proxy1)
Else
End If
Next
objUser.SetInfo
WScript.echo " script finished."
End If
wfile.Close
it is at the objUser.PutEx ADS.... line that the script does not work or
produce any errors.
can anyone point me in the right direction
Thanks
Mark Tag: personal cert Tag: 173755
objWMIService.ExecQuery
Can anyone tell me how to get a variable into the following code in
place of >>notepad.exe<<
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
Set colProcessList = objWMIService.ExecQuery("SELECT * FROM
Win32_Process WHERE Name = 'notepad.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
TIA
*** Sent via Developersdex http://www.developersdex.com *** Tag: personal cert Tag: 173754
Ping
I have routine batch file that pings the server's in my list and tells me UP
or DOWN.
Does anyone have a VBS version of this, I would like the output displayed in
html with green for UP and red for down.
Here is the sample of batch file currently used:
This is ping.bat
@echo off
for /f "delims=, tokens=1*" %%a in ('type Ping.txt') do (ping %%a|find
"TTL">nul
if not errorlevel 1 (echo %%b : UP) else (echo %%b : Down))
This is ping.txt
192.168.7.101, Richmond Router
192.168.7.102, PDC in NY
192.168.7.103, Exchange in FL
Thanks Tag: personal cert Tag: 173753
TextFile not saved
Hello all,
I am having a problem with saving from DOS-commands
the following script is an example:
'Start
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.run "ping.exe 127.0.0.1 >> c:\ping.txt",3,True
'End
I expected to find a textfile "ping.txt" in de root from c:\ but nothing was
there.....Can someone help me? Am i forgetting something?
The problem does not occur when i run the same command from the console,
then the textfile is saved. It is not only the ping command but this is just
an
example That Should work.
Kind Regards Tag: personal cert Tag: 173749
Remotely searching for files
I am a VB newbie. I need help with a script that will allow me query a
list of server (about 30) for two or more files and log the modified
times to a txt file.
--
nnanna
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------ Tag: personal cert Tag: 173748
rename a file
hello, i wondered if anyone would know how to name or rename a file with a
variable generated from output within the same script
ex
dim objfile
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile("nwfp.txt")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set printers = objWMIService.ExecQuery("SELECT * FROM Win32_Printer", "WQL",
_ wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In compname
ObjFile.WriteLine
ObjFile.WriteLine "=========================="
ObjFile.WriteLine "printers and network folders for " & objitem.name
ObjFile.WriteLine "=========================="
objfile.writeblanklines(2)
next
objfile.copyfile "nwfp.txt", objitem.name Tag: personal cert Tag: 173745
Word to Html
I am a newbie of vbscript, I have searched many post but few of them
is about to make a Word file to be able to post as a html. So I wrote
the following script and it work for me. Now I post the code here for
somebody need it and would be appreciate if there is any better way to
do that. Please copy and paste the following code as a html file and
place the Word file in the folder containing this html file.
------------------------------------------------------------------------------
<html>
<body>
<script language="vbscript">
<!--
'Define Constants
Const wdFormatHTML = 8
Const ForReading = 1
'Define File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Define Current Directory and replace "%20" by a space
strPath = Replace(objFSO.GetParentFolderName(Replace(document.location.pathname,"/","")),"%20","
")
'Get the Word Document
strDocname = "WordFile.doc"
'Get the file name of the Word Document
strFilename = Left(strDocname,(Len(strDocname)-4))
'Define the temp html filename after converted the Word Document
strHtmlname = strFilename & ".htm"
'Check the existance of the Word File before continue
If objFSO.FileExists(strPath & "\" & strDocname) Then
'Create the Word Application implicitly
Set objWord = CreateObject("Word.Application")
objWord.Visible = False
'Open the Word Document
Set objDoc = objWord.Documents.Open(strPath & "\" & strDocname)
'Convert the Word Document as a temp html file
objDoc.SaveAs strPath & "\" & strHtmlname, wdFormatHTML, True
'Quit Word Application
objWord.Application.Quit False
'Open the converted temp html file
Set objTempHtml = objFSO.OpenTextFile(strPath & "\" & strHtmlname,
ForReading, True)
'Read the temp html file until the end of the file
Do While objTempHtml.AtEndOfStream <> True
strTempHtml = objTempHtml.ReadLine
If LCase(Left(strTempHtml,7)) <> LCase("<Title>") Then
document.write(strTempHtml & vbCrLf)
Else
document.write("<Title>" & strFilename & "</Title>" & vbCrLf)
End If
Loop
'Close the temp html file
objTempHtml.Close
'Delete the temp html file
objFSO.DeleteFile strPath & "\" & strHtmlname, True
If objFSO.FolderExists(strPath & "\" & strFilename & ".files") Then
objFSO.DeleteFolder strPath & "\" & strFilename & ".files", True
End If
'Release objects
Set objTempHtml = Nothing
Set objDoc = Nothing
Set objWord = Nothing
Else
document.write(strPath & "\" & strDocname & " does not exist.")
End If
Set objFSO = Nothing
-->
</script>
</body>
</html>
------------------------------------------------------------------------------- Tag: personal cert Tag: 173741
display a gif while a child process is active
Hello all. I have an HTA that calls and runs other VBScripts as
external processes. When a user does that, I would like to display a
gif on the original HTA...then make that gif invisible when the
external process finishes. I am guessing I will have to check the
process list in a while loop and inside there toggle this gif. Can
someone post a small example of how to do this? Tag: personal cert Tag: 173733
Display processes but not allow to move on until they are closed
Dear Gurus,
I want to create a script that will display a specific list of
applications (processes) that are running, but not allow the user to
carry on untill all of the applications are closed. Tag: personal cert Tag: 173732
Altering file name in ASPUpload
Hi,
I am using ASPUpload to upload a txt or doc file to my server.
An email is then generated to a pre determined recipient which includes the
file as an attachment.
I have this working fine, but what I want to do is generate a random number
and prefix the file name with this number before it is saved to the server,
to prevent a file being uploaded with an identical file name to one that is
already there.
so, a file called CV.doc might be saved to the server something like this -
55644824042005CV.doc
I'm having trouble getting it to save the file with the random number as
part of the file name. It just saves as the original file name.
As you may see from the code I then want the text of the email that is sent
to include a link to the document
Any help appreciated (the only thing I have changed below is any refernce to
the domain name/email address being used
~~~~~~~~~~~~~~~
<%
DIM File, Upload, Count, Ext
DIM Mail, strMsgHeader
Set Upload = Server.CreateObject("Persits.Upload.1")
Count = Upload.SaveVirtual("cv_files/")
IF NOT Count=0 THEN
FOR EACH File IN Upload.Files
Ext = UCase(Right(File.Path, 3))
IF Ext <> "TXT" AND Ext <> "DOC" THEN
Response.Write "Sorry, your resume " & File.Path & " is not in a .DOC or
.TXT format and has not been delivered through our system. Please save your
resume in one of these formats and resubmit it."
File.Delete
ELSE
'To create a document ID
Dim ID
Dim randomnum, datenum
randomize
randomnum = int((9999999-1000000+1) * rnd + 1000000)
datenum = replace(date,"/","")
ID=randomnum & datenum
Set File = Upload.Files("fResume")
If Not File Is Nothing Then objRSr("fResume").Value = File.Binary
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "mail_host_goes_here"
Mail.From = Upload.Form("Email")
Mail.AddAddress "email_address_here"
Mail.Subject = "CV sent via your website"
strMsgHeader = "This email was delivered from your website." & vbCrLf &
vbCrLf
Mail.Body = strMsgHeader & "Email: " & Upload.Form("Email") & vbCrLf &
"First Name: " & Upload.Form("Name") & vbCrLf & vbCrLf & "Comments: " &
Upload.Form("Comments") & vbCrLf & vbCrLf & "The document can be viewed here
http://www.domain_name_here/site/test/rbh/cv_files/"
IF Count > 0 THEN
Mail.AddAttachment Upload.Files(1).Path
On Error Resume Next
Mail.Send
IF Err <> 0 THEN
Response.Write "There was an error sending your message. Please visit
our Contact Us page and send a message to our Webmaster to report this
error: <B>" & Err.Description & "</B>"
ELSE
Response.Write Upload.Form("Name") & ","
Response.Write "<p>Thank you for contacting our recruiter. Your resume
has been received and will be reviewed shortly. If we have a position is
available that matches your skills, we will contact you to schedule an
interview. We keep all resumes on file for a period of 6 months, please feel
free to resubmit your resume after this time for future consideration.</p>"
File.Delete
END IF
END IF
end if
next
end if
%> Tag: personal cert Tag: 173730
Copy file if created today....
Hi all!
I need a vbscript that will look in a folder that has a bunch of files in
it. If it finds a file that was created 'today', it will take that file and
copy it to another location. Any way I can use CopyFile method to do this?
Any input appreciated!
TIA;
Örjan Tag: personal cert Tag: 173729
Outlook settings
I'm trying to find a script that copies user settings for outlook so that
when I ghost thier machine and reinstall outlook their settings can be
reimported. Tag: personal cert Tag: 173728
HTA Text input & enter key?
I have an HTA which accepts a username via a text input box and a seperate
"submit" button.
Is there a way I can do away with the "submit" button and have the input
text accepted with the "Carriage Return" key?
I can see all sorts of events to do with mouse over, click, dbl clk etc but
nothing that looks like on_enter.
There is an "on_key" event, so do I use that and parse for the enter key? Tag: personal cert Tag: 173724
DCOM Launch Permissions using VBScript
I have DCOM application which registers it's name under MMC\Component
Services\Computers\My Computer\DCOM Config\ECMAgtScheduler.
When I view the default launch security on this object Administrators
and System have "Allow" access. I would like to add a domain service
account to "Allow" access as well. I would like to perform this option
via vbscript if possible.
Any links to a example or documentation would be very helpful.
Thanks in advance.
Dave Tag: personal cert Tag: 173722
Problems with VB apps running on a MDB 97 Database
We have a system called LOTS which is an integrated dispense and Point of
Sale System for Retail Pharmacy. The system is very basic, it uses a VB GUI,
Crysal Reporting Mechanism with a MDB 97 back end. Our network currently has
5 Clients (running Windows XP) and a server (running Server 2003 SBS
Standard) on a basic domain setup.
Every day between 5:45 PM and 6:30 PM our one of our network clients that is
has the Point of Sale module open comes up with the error "Object Variable
Block", i have had a look on our network and there are no sheduled tasks
running at that time and PC it self which has only been recently installed
along with the rest of the network is in good order. This error dose not
occur on any other machine and only occurs between these times everyday.
If anyone has any ideas about this or would like a copy of the program to
analyse, then please contact me.
Thanks Tag: personal cert Tag: 173718
Consuming WebService from vbscript
Hi everyone,
I have a vbscript which is consuming WebMethods from a WebService. Whenever
the WebMethod returns a string or integer then no problem but when
the WebMethod returns a DataSet then the following error appears:
Error:
Attachment:Maximum retry on the connection exceeded. HRESULT=0x80004005:
Unspecified error
- Client:An unanticipated error occurred during the processing of this
request. HRESULT=0x80004005: Unspecified error
- Client:Sending the Soap message failed or no recognizable response was
received HRESULT=0x80004005: Unspecified error
- Client:Unspecified client error. HRESULT=0x80004005: Unspecified error
Here is the code:
Dim SOAPClient
Dim Result
Set SOAPClient = CreateObject("MSSOAP.SOAPClient30")
SOAPClient.mssoapinit ("http://localhost/ARMService.asmx?wsdl")
Result = SOAPClient.GetSomething( ) 'Here is where the exception is
thrown. The WebMethod returns a DataSet.
Can anyone tell me how I could handle these DataSet in vbscript?
Cheers. Tag: personal cert Tag: 173714
I am looking for ways to export the personal cert *.pfx file with a password
on a Windows XP SP1 machine. Is this possible?