Help with Script.
Guys,
I need a little help here...
This is case, I have a batch of files that I need to edit in photoshop.
I'm trying to use the below code to accomplish this, but it seems that I'm
doing something wrong or missing something.
I need an array to bound all files of type *.jpg; then open Photoshop use
automation to do minor conversion for web viewing and go to the next.
I attempted to do this but I don't know what going on.
Any help will be greatly appreciated
Neil Pilier
npilier@miami.edu
Snipped code
--------------------------------------------------------------------
Option Explicit
Dim fso, f, f1, i, s, myArray(), ws, oAutoIt, iii
redim myArray(0)
set fso = CreateObject("Scripting.FileSystemObject")
set f = fso.GetFolder ("C:\test")
set ws = WScript.CreateObject("WScript.Shell")
set oAutoIt = CreateObject("AutoItX.Control")
For Each f1 In f.Files
redim preserve myArray(Ubound(myArray) + 1)
myArray(Ubound(myArray)) = f1.Name
Next
On Error Resume Next
for iii = 0 to ubound(myArray)
If lcase(fso.GetExtensionName(myArray(i))) = "jpg" then
ws.Run ("Photoshop.exe " & myArray(iii))
WScript.Sleep 6000
ws.AppActivate "Adobe Photoshop"
ws.SendKeys " "
ws.SendKeys "%(+^s)"
WScript.Sleep 500
oAutoIt.LeftClick 864, 296
WScript.Sleep 500
oAutoIt.LeftClick 843, 395
oAutoIt.LeftClick 843, 395
WScript.Sleep 500
ws.SendKeys "392"
WScript.Sleep 500
oAutoIt.LeftClick 864, 509
WScript.Sleep 500
oAutoIt.LeftClick 863, 56
WScript.Sleep 500
ws.SendKeys "{TAB 2}"
WScript.Sleep 500
ws.SendKeys "{ENTER}"
WScript.Sleep 500
ws.SendKeys "^(w)"
WScript.Sleep 500
ws.SendKeys "{TAB}"
WScript.Sleep 500
ws.SendKeys " "
WScript.Sleep 500
end if
Next
set fso = nothing
set f = nothing
set ws = nothing
set oAutoIt = nothing Tag: Help with Script. Tag: 144185
Payflow response
Hi everyone. Using active server page I am sending a transaction to VERISIGN
and getting a response back from verisign. The response is written to the
page through the following value.
response.write name
response.write " = "
Response.Write value
I am trying to get the response split namely the PNREF,
RESPONSE,APPROVAL,ETC and insert some information into the database and
also redirect the user to a page based on the response I get back.
Can someone please help me with a script, iam entirely new to this.
Thanks
Ola Tag: Help with Script. Tag: 144184
Help with Script.
Guys,
I need a little help here...
This is case, I have a batch of files that I need to edit in photoshop.
I'm trying to use the below code to accomplish this, but it seems that I'm
doing something wrong or missing something.
I need an array to bound all files of type *.jpg; then open Photoshop use
automation to do minor conversion for web viewing and go to the next.
I attempted to do this but I don't know what going on.
Any help will be greatly appreciated
Neil Pilier
npilier@miami.edu
Snipped code
--------------------------------------------------------------------
Option Explicit
Dim fso, f, f1, i, s, myArray(), ws, oAutoIt, iii
redim myArray(0)
set fso = CreateObject("Scripting.FileSystemObject")
set f = fso.GetFolder ("C:\test")
set ws = WScript.CreateObject("WScript.Shell")
set oAutoIt = CreateObject("AutoItX.Control")
For Each f1 In f.Files
redim preserve myArray(Ubound(myArray) + 1)
myArray(Ubound(myArray)) = f1.Name
Next
On Error Resume Next
for iii = 0 to ubound(myArray)
If lcase(fso.GetExtensionName(myArray(i))) = "jpg" then
ws.Run ("Photoshop.exe " & myArray(iii))
WScript.Sleep 6000
ws.AppActivate "Adobe Photoshop"
ws.SendKeys " "
ws.SendKeys "%(+^s)"
WScript.Sleep 500
oAutoIt.LeftClick 864, 296
WScript.Sleep 500
oAutoIt.LeftClick 843, 395
oAutoIt.LeftClick 843, 395
WScript.Sleep 500
ws.SendKeys "392"
WScript.Sleep 500
oAutoIt.LeftClick 864, 509
WScript.Sleep 500
oAutoIt.LeftClick 863, 56
WScript.Sleep 500
ws.SendKeys "{TAB 2}"
WScript.Sleep 500
ws.SendKeys "{ENTER}"
WScript.Sleep 500
ws.SendKeys "^(w)"
WScript.Sleep 500
ws.SendKeys "{TAB}"
WScript.Sleep 500
ws.SendKeys " "
WScript.Sleep 500
end if
Next
set fso = nothing
set f = nothing
set ws = nothing
set oAutoIt = nothing Tag: Help with Script. Tag: 144183
Help with Script.
Guys,
I need a little help here...
This is case, I have a batch of files that I need to edit in photoshop.
I'm trying to use the below code to accomplish this, but it seems that I'm
doing something wrong or missing something.
I need an array to bound all files of type *.jpg; then open Photoshop use
automation to do minor conversion for web viewing and go to the next.
I attempted to do this but I don't know what going on.
Any help will be greatly appreciated
Neil Pilier
npilier@miami.edu
Snipped code
--------------------------------------------------------------------
Option Explicit
Dim fso, f, f1, i, s, myArray(), ws, oAutoIt, iii
redim myArray(0)
set fso = CreateObject("Scripting.FileSystemObject")
set f = fso.GetFolder ("C:\test")
set ws = WScript.CreateObject("WScript.Shell")
set oAutoIt = CreateObject("AutoItX.Control")
For Each f1 In f.Files
redim preserve myArray(Ubound(myArray) + 1)
myArray(Ubound(myArray)) = f1.Name
Next
On Error Resume Next
for iii = 0 to ubound(myArray)
If lcase(fso.GetExtensionName(myArray(i))) = "jpg" then
ws.Run ("Photoshop.exe " & myArray(iii))
WScript.Sleep 6000
ws.AppActivate "Adobe Photoshop"
ws.SendKeys " "
ws.SendKeys "%(+^s)"
WScript.Sleep 500
oAutoIt.LeftClick 864, 296
WScript.Sleep 500
oAutoIt.LeftClick 843, 395
oAutoIt.LeftClick 843, 395
WScript.Sleep 500
ws.SendKeys "392"
WScript.Sleep 500
oAutoIt.LeftClick 864, 509
WScript.Sleep 500
oAutoIt.LeftClick 863, 56
WScript.Sleep 500
ws.SendKeys "{TAB 2}"
WScript.Sleep 500
ws.SendKeys "{ENTER}"
WScript.Sleep 500
ws.SendKeys "^(w)"
WScript.Sleep 500
ws.SendKeys "{TAB}"
WScript.Sleep 500
ws.SendKeys " "
WScript.Sleep 500
end if
Next
set fso = nothing
set f = nothing
set ws = nothing
set oAutoIt = nothing Tag: Help with Script. Tag: 144182
copying data from tape drive
Hi,
How do i write a script to copy contents of remote tape drive which is
running NTBackup, to my computer?
thanks Tag: Help with Script. Tag: 144180
Runas script
I have a script that looks like this:
set WshShell = CreateObject("WScript.Shell")
WshShell.Run "runas /user:mrx""e:\test.exe -10.0.0.1 -
kalle -olle"""
WScript.Sleep 100
WshShell.Sendkeys "password~"
It works fine. but I want to use this script on a
terminalserver, and therefore I want to create a shortcut
that starts my vbscrip like this.
myvbscript.vbe -x -y -z
Where x= ipaddress, y= username, z=password
How du I send this startup parameters to my vbscript Tag: Help with Script. Tag: 144177
Independent processes and file renaming
What I need: A way to open a bunch of internet shortcuts from a vbs or
jscript script on Win2K SP3 with independent processes.
My Problem: I work in a helpdesk that has a lot of "online" tools. I
usually have 6-15 web pages open at any given time. But there is this one
that always crashes every few hours. When it crashes IE has to be
restarted. When I log on I have a bunch of URL shortcuts in my Startup
folder. If I've opened them all up (including the evil program)
automatically from the Startup folder, at logon, they all close when that
one troublesome program crashes.
I know I could just open up the evil program last by itself but I don't want
to. What can I say; I just want to make this work my way.
Is there a way to have a script read a text file full of URLs and open them
up with independent processes using an unaltered WSH from Win2K SP3? I
can't alter the computer in any way to support PERL or Python or anything
else... I'm stuck with VBScript or Jscript.
Request #2
I want to write a script that renames a bunch of files in a directory using
a certain convention like file file01.jpg, file02.jpg, etc...
Everywhere (including MSDN) says that with the FIlesystemObject in the WSH
can't do that with binaries like jpegs. Is there any way around that? What
about using .bat files? I've seen some very cool .bat files but I haven't
been able to find a reference for how to create all the detailed parts of
one. If you can help with that please let me know.
Thanks in advance
Nathan Tag: Help with Script. Tag: 144172
TIP - Regular Expression for Returning Text up to a Blank Line - [\s\S]*?(?:\r?\n){2}
This is a useful ditty that someone sent me. I had wanted to return a
section of a string extracted from a Text File from a particular point
up until the first blank line.
The pattern to use is "[\s\S]*?(?:\r?\n){2}".
[\s\S]*? - Any number of any characters or no character at all. The
"?" at the end makes the SubMatch non-greedy i.e. it only matches the
first occurrence. I am not sure why the "?" is necessary but you could
give it a go without it. It may just speed the matching process; just
do enough matching to say that there are "0 or more matches" and then
move on to next pattern i.e. "(?:\r?\n){2}".
(?:) - Don't return this sequence as a SubMatch. Note this is only
needed if you intend to get SubMatches and not just match the entire
string. It is a heavy price to pay for wanting to group characters
whilst also wanting SubMatches.
\r?\n - Carriage Return (optional due to "?") and Line Feed
(required). Note that some Operating Systems/Editors do not put a
Carriage Return in files.
(?:\r?\n){2} - Two such CRLF sequences in series with nothing in
between and not returned as a submatch.
Hope this is of use to someone out there 8:-)>
D. Rocke,
Scotland. Tag: Help with Script. Tag: 144171
Global.asa and application recordset variable ...
Hi !
I'm trying to declare and initialize application variable which will be of
type "ADODB.Recordset". I would then also fill it with values in Global.asa.
Idea is to create application recordset and fill it with some data from
database (so recordset will hold data in memory). Then every other page
would access that recordset to show data in asp pages.
How to do that ?
Thanks,
Drago. :-) Tag: Help with Script. Tag: 144169
HELP. WMI check and reg check script
Guys,gals,
I am working on a problem at the moment in where I need to patch about
60 Armada e500 laptops . I want to write a vbscript to do this. I was
thinking about doing a Win32_ComputerSystem _ Model and doing a quick
check of the registry to see if the patch is install .. blah.. and
then install if it doesn't exist. I have next to no Vb experience and
just need a quick hand getting going and I should be right . So far I
have
StrComputer=InputBox("Enter Computer Name ")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & StrComputer &
"\root\cimv2")
Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer2 in colSettings
objFile.WriteLine "Manufacturer: " & Chr(9) &
objComputer2.Manufacturer
objFile.WriteLine "Model : " & Chr(9) & objComputer2.Model
Next
I don't know how to check with vb for a reg key . but I need to check
if
HKEY_LOCAL_MACHINE\SOFTWARE\Compaq\PWRCON32.CPL\4.10
exists and then install a install.cmd file I have created with the
approiate strings. Can someone help me through this together. Tag: Help with Script. Tag: 144161
How can I tell if a worksheet exists?
Hi,
I want to determine if a worksheet named Sheets("Chart") exists. How can I
do this using VBA?
Thank you,
Robert Stober Tag: Help with Script. Tag: 144154
add my web site to the favorite in IE
I want to make a link that allows users to add my web site to the favorite
in IE. Anyone knows how to do that? Tag: Help with Script. Tag: 144148
Retrive exchange mailbox info
Is there a way with vbscript to enumerate exchange mailbox info for =
users? ie mailbox size, last logon date, last logon user? similar to =
what you see from the exchange admin utility?
I can't locate anything in there.
If RTFM please point me to the proper M :-)
Thanks
-Matt Tag: Help with Script. Tag: 144146
Using VBS to check that an ActiveX control was installed properly?
Hi,
Is there a way to have some VBScript in a web page after an
OBJECT section to make sure that an ActiveX control or its
prerequirements (VB run-time, etc.) is correctly installed on the
client host?
I've seen some registry-related samples in VBScript, but they seem to
require the WSH package to be installed prior to running this type of
VBScript code.
Thank you
JD. Tag: Help with Script. Tag: 144144
Excel and HTML
Hoi,
IN vbs i used this code
--------------------------------------------------
Set objXL = GetObject(,"Excel.Application")
If objXL Is Nothing Then
rem no excel active
else
msgbox "Close Excel Please"
End If
set objxl = nothing
--------------------------------------------------
when I use this code in HTML vbscript it won't work
anyone idees
thanks
Jan Tag: Help with Script. Tag: 144143
regular expression for SQL fields
hi all
I have a string like this:
dbo.ManageDate(Now(),5,"A") as Mdate,mid(Company,1,5) as s,
dbo.GetSocCode(mid(Company,7,5)) as sCode
this is the part of a SQL query between SELECT and FROM.
What Regular expression returns the fields separately i.e.
- dbo.ManageDate(Now(),5,"A") as Mdate
- mid(Company,1,5) as s
- dbo.GetSocCode(mid(Company,7,5)) as sCode ?
Can't use comma as separator (appears in function, too).
i tried to use only commas NOT in () , but i failed... Tag: Help with Script. Tag: 144139
Handing control over to a new window
My client side program opens a new HTML page using "window.open".
I would expect "Sub window_onload" to fire up in the new HTML page,
but it doesn't and I can't figure out why. Any ideas? Thanks. Tag: Help with Script. Tag: 144136
Any way to reboot system with script?
I have a script that sets some registry values with VBScript, but I have to
reboot for the changes to take effect. Is there a way to include a command in
the script that will cause the system to shut down and reboot, as if I used Shut
down > Restart on the Start menu?
Thanks!
--
Dave "Crash" Dummy - A weapon of mass destruction
crash@gpick.com
http://lists.gpick.com Tag: Help with Script. Tag: 144132
Creating chart via VBA - need help with Source:=Range()
Hi,
I've got a macro that creates a chart from an Excel but I don't know how
many rows the spreadsheet may contain. The table has six columns but I only
want to graph two of them, and the aren't adjacent in the table (for
instance columns 1 and 4). Becuase I don't know how many rows, and because
the columns aren't adjacent, I'm having trouble specifying the correct range
object to the Source attribute of the
chartObjects.Chart.SeriesCollection.Add method.
I've tried numerous ways to make it work but they all have problems. For
example, this one works but I don't want to hard code the values(e.g.,
"A1:A815")
With Sheets(sheetName)
co.Chart.SeriesCollection.Add _
Source:=.Range("A1:A815,D1:D815"), _
Rowcol:=xlColumns, SeriesLabels:=True, CategoryLabels:=False
End With
Anyone got any ideas?
Thank you,
Robert Stober Tag: Help with Script. Tag: 144130
Regular Expression problem continued
Thanks to Steve Fulton, I have been able to successfully extract this
string:
N25B-357.484A0.
from this string:
N25G1G8G43G54G90G93X57.556Y115.72Z-131.128B-357.484A0.F10.0H16M8
My question is: Why doesn't the following function work on this extracted
string if there are no values after the decimal?
Function ChangeA(Match, N, B, A, Index, Source)
ChangeA = "N" & (N+1) & "B" & (B+0.1) & "A" & (A+0.1)
End Function
If the string was N25B-357.484A123.456 it would work perfectly.
Thanks
Dan Tag: Help with Script. Tag: 144128
Controlling the printer from Web App
Hello,
I have an app that produces invoices. I would like to
create a button that will print all the invoices. The
only problem is that as each invoice is created on the
page and using javascript prints, it give up the windows
printer dialog box. So if you have 10 invoices to print,
you get 10 dialog boxes. Is there a better way to control
the printer? Without having to buy a third party tool.
Thanks.
p.s. My real email is
(M i c h a e l @ T h e B i g O n i o n . c o m) Tag: Help with Script. Tag: 144127
* Newsgroup doc. and 7269 Tips, Tricks, and Registry Hacks - 01-Oct-2003 09:00.22 *
01-Oct-2003 09:00.22.
Please see the Microsoft Newsgroups page at
http://communities.microsoft.com/newsgroups/default.asp
Visit Windows & .NET Magazine's 7269 tips at http://www.jsiinc.com - press the
"Tips & Tricks" button.
Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com Tag: Help with Script. Tag: 144126
setRequestHeader Content-Type with charset
Hello,
i have an Microsoft.XMLHTTP Object in VBS and do
setRequestHeader "Content-Type", "text/xml; charset=utf-8"
but the Server does return a non utf-8 xml stream.,
but i need this, because of german umlauts.
What do i wrong??
Thanks
Markus Tag: Help with Script. Tag: 144124
Giving the user option to expand sections
Hi
Very new to this...
I would like to set up the following:
The web user does a search of a database and the results are returned in an
HTML table. I want to present the user with a table that just shows the
salient facts (brief item description, stock value, etc).
However, I'd like to give the user the opportunity to expand (and if they
wish to contract again) any one row of the table to display things like a
picture and an extended description of the row item, rather than have them
go to a separate page for this.
I'd also like to give them the option to expand all rows in the table (and
contract them again) if they wished.
What's the best way to achieve this? I'm not sure of the target audience,
so may have to support browsers using HTML4 (may even be Netscape...)
Thanks for any advice you may be able to give
Griff Tag: Help with Script. Tag: 144120
[?] Object to Access 97 or Acces XP
I have installed on my Pc Access97 and AccessXP, how i can create an Object
that reference on Access97, and an other that reference AccessXp.
The instruction:
Set oApp = CreateObject("Access.Application")
create an object of the last type of mdb open
Thanks and excuse me for my english
--
Pennywise
Questo messaggio è composto al 100% da
elettroni riciclati. Nessun atomo è stato
ionizzato per trasmettere questo messaggio. Tag: Help with Script. Tag: 144116
unlimited timeout
Hi guyz,
anybody know how to set timeout = unlimited
AS I know the keyword is resolvetime out
but I dont know how to use it.
anybody can gimme a clue ?
Thx Tag: Help with Script. Tag: 144114
Graphing only two columns
Hi,
I've got a spreadsheet that contains six columns. I want to generate a chart
via a macro, but I don't know how many rows the spreadsheet may contain.
I've tried numerous ways to make it work but they all have problems. Here's
what I've tried:
' This one works but I don't want to hard code the values(e.g., "A1:A815")
With Sheets(sheetName)
co.Chart.SeriesCollection.Add _
Source:=.Range("A1:A815,D1:D815"), _
Rowcol:=xlColumns, SeriesLabels:=True, Categorylabels:=True
End With
' This one doesn't make a chart at all although it seems like it *should*
work:
Source:=.Range(.Range("A1").End(xlDown), .Range("D1").End(xlDown)), _
' This one plots columns 1,2 3, and 4 but I only want 1 and 4:
Source:=.Range(.Range("A1").EntireColumn, .Range("D1").EntireColumn), _
' This one causes compile error:
Source:=.Range(Union(Columns(1), Columns(4)), _
Anyone got the solution?
Thank you,
Robert Stober Tag: Help with Script. Tag: 144109
vbscript in web page
I have the following lines in a LAN application.
........
Set objNet = CreateObject("Wscript.Network")
es="User name: " & objNet.UserName
........
On my PC it works fine, on the "test" system it fails with an "Object
required" at the second line.
What program is handling the interpretation of these lines? Is it IE itself
or does it use Wscript within IE to host it, or something else still?
I know that wscript.exe on the test system is older, could this be the
cause? If so, is wscript part of a Windows Update, or must it be
specifically installed? (This latter information is needed as it will affect
our installation instructions.)
I appreciate any help or advice you can offer
--
Rickety Tag: Help with Script. Tag: 144108
Authenticating from separate domain
Hi,
I'm developing an Internet site that is going to be
password protected. I have one windows 2000 domain on the
Internet side of things, and another on an Intranet side.
Is there any way to authenticate a user that hits my
Internet pages against the Intranet user database?
....like a user of either domain can go to this web page,
a user from only the intranet domain can access that web
page....etc. I just don't want to have to create a new
user on the Internet domain when I already have them set
up on the Intranet....but I'll also have users that are
Internet-only and I don't want any of them to access
Intranet material. Tag: Help with Script. Tag: 144105
new to SQL Server - basic advice
Sorry if this is OT for this group. I'm completely new to SQL Server and am
looking into a project developing an ASP mailing list tied to a SQL Server
backend. I've looked over the Microsoft Books Online, but haven't found the
information that I need to help me out. I want to setup SQL Server on my
local PC, build the database for the application locally and learn how to
replicate the database to the web server. I don't know how to begin, so any
suggestions are appreciated. Any good books or online resources that can
walk a newcommer through these steps? Any help is appreciated. Thanks in
advance.
-D- Tag: Help with Script. Tag: 144099
VB Script to Add Path Statement in Environmental Variables
I still trying to figure out VB scripting with logons. I have an app that
requires a
environmental variable path to be set before app works. My goal is to come
up
with a script that on logon checks for value and adds if needed.
User Variable:
"T:\Share\App\App.exe;T:\Share\App"
Any tips or hints would be great... not sure how to add environmental
variables
through scripts.
thanks in advance
rob bartley Tag: Help with Script. Tag: 144098
Need help with updating database tables
Hello,
I want to be able to execute an update statement to a table with an MSSQL
database. I would like to able to return the results to a variable. What
would be the best method to do this. Forgive me as I am new to this type of
stuff.
Jeff Tag: Help with Script. Tag: 144096
Dropdownlist auto drop onfocus URGENT
How do I make my dropdownlist to automatically drop when
it gets focus so that the user doesnt have to click to
drop down.
Please help Tag: Help with Script. Tag: 144092
Calling from file rather than a InputBox
I am trying to call a list of computer names from a file rather than
entering them manually as a input box.
Can anyone assist with this?
I know I need a Do while Loop but I am unsure how to impliment.
I would greatly appreciate it.
Thanks in advance
Ben
Dim strComputerName ' The Computer Name to be queried via WMI
Dim strWinMgt ' The WMI management String
Dim objCon ' A Connection Object for database connectivity
Dim objRS ' A Recordset Object for database connectivity
Dim sProviderName ' The OLE Provider Type
Dim iCursorType ' The Cursor Type for the Recordset
Dim iLockType ' The Lock Type for the Recordset
Dim sDataSource ' The name and location of the database
Dim intCompID ' A computer ID asssigned when the computer is added to the
database
Dim intRam ' The amount of RAM in the computer.
'
' Get the Computer Name to Collect Information For
'
strComputerName = InputBox("Enter the name of the computer you wish to
query")
strWinMgt = "winmgmts://" & strComputerName &""
'
' Write Computer Info to Database
'
call subConnectionOpen
call subWriteComputerInfo
call subWriteDiskInfo
call subWriteIPInfo
call subConnectionClose
wscript.echo "Finished Collection Information for the System."
Sub subConnectionOpen
Set objCon = CreateObject("ADODB.Connection")
Set objRS = CreateObject("ADODB.Recordset")
sProviderName = "Microsoft.Jet.OLEDB.4.0"
iCursorType = 1
iLockType = 3
sDataSource = "dbCompInfo.mdb"
objCon.Provider = sProviderName
objCon.Properties("Data Source") = sDataSource
objCon.Open
End Sub
Sub subConnectionClose
set objRS = nothing
set objCon = nothing
End Sub
Sub subWriteComputerInfo
Set CompSysSet = GetObject(strWinMgt).ExecQuery("select * from
Win32_ComputerSystem")
for each CompSys in CompSysSet
strDescription = CompSys.Description
strModel = CompSys.Model
strName = CompSys.Name
intRAM = Clng(CompSys.TotalPhysicalMemory/1000000)
next
objRS.CursorType = iCursorType
objRS.LockType = iLockType
objRS.Source = "tblComputer"
objRS.ActiveConnection = objCon
objRS.Open
objRS.AddNew
objRS("strName") = strName
objRS("strModel") = strModel
objRS("strDescription")= strDescription
objRS.Update
intCompID = objRS("ID")
objRS.Close
objRS.CursorType = iCursorType
objRS.LockType = iLockType
objRS.Source = "tblMemory"
objRS.ActiveConnection = objCon
objRS.Open
objRS.AddNew
objRS("intCompID") = intCompID
objRS("intRAM")= intRam
objRS.Update
objRS.Close
End Sub
Sub subWriteDiskInfo
'
' Get Disk Information
'
Set DiskSet = GetObject(strWinMgt).ExecQuery("select
FreeSpace,Size,Name from Win32_LogicalDisk where DriveType=3")
objRS.CursorType = iCursorType
objRS.LockType = iLockType
objRS.Source = "tblDisk"
objRS.ActiveConnection = objCon
objRS.Open
For each Disk in DiskSet
strDisplayDiskInfo = strDisplayDiskInfo & "Drive " & Disk.Name &
" Free Space: " & Clng(Disk.FreeSpace/1000000) & " MB Total Size: " &
Clng(Disk.Size/1000000) & " MB"& vbCrlf
if len(Left(disk.name,1)) >0 then
objRS.AddNew
objRS("intCompID") = intCompID
objRS("strDriveLetter") = Left(disk.name,1)
objRS("strFreeSpace") = Clng(Disk.FreeSpace/1000000)
objRS("strTotalSpace")= Clng(Disk.Size/1000000)
objRS.Update
end if
Next
objRS.Close
' Wscript.echo strDisplayDiskInfo
End Sub
Sub subWriteIPInfo
set IPConfigSet = GetObject(strWinMgt).ExecQuery("select * from
Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
objRS.CursorType = iCursorType
objRS.LockType = iLockType
objRS.Source = "tblIPInfo"
objRS.ActiveConnection = objCon
objRS.Open
for each IPConfig in IPConfigSet
if Not IsNull(IPConfig.IPAddress) then
for i=LBound(IPConfig.IPAddress) to
UBound(IPConfig.IPAddress)
' WScript.Echo "IPAddress: " & IPConfig.IPAddress(i) & "
Subnet: " &_
' IPConfig.IPSubnet(i) & "MAC Address " &
IPConfig.MACAddress
objRS.AddNew
objRS("intCompID") = intCompID
objRS("intNICID") = i
objRS("txtIPAddress") = IPConfig.IPAddress(i)
objRS("txtSubnetMask")= IPConfig.IPSubnet(i)
objRS("txtMACAddress")= IPConfig.MACAddress
objRS("txtServiceName")= IPConfig.ServiceName
objRS("txtDescription")= IPConfig.Description
objRS.Update
next
end if
next
objRS.Close
End sub Tag: Help with Script. Tag: 144090