Turning up the volume from VBScript
Is it possible to adjust or set your system speaker volume
using VBScript? Just toying with making the PC real noisy
if I need it to get my attention. Thanks BK Tag: compile the code. Tag: 145686
Release handle of a file
Hi All,
We have a process which updates a file and then ftp to remote location
. Currently we use a software 'Gentran '.
At times this file get hold by Gentran services and next run of
process, fail in reading/writing to this file.
Now the only option is to stop/start Gentran services and this will
release the lock on the file.
Is there any programming way to release the lock on a file after each
process.
Any help with related topics / links will be of great help
Thanks In Advance
WU Tag: compile the code. Tag: 145675
Sending email from VBS thru SMTP?
I am trying to send an email from a VBscript, outbound
thru an SMTP server. My SMTP wants logon validation and I
have not found how to do that yet! If I use MAPI and
reference my 'Profile' which contains the login
credentials then Outlook cries foul thinking my script is
a virus trying to hijak my email account!
How do I pass credentials from the script to send the
email w/o getting frisked by outlook's security? Tag: compile the code. Tag: 145671
change video resolution
I am trying to find a script that will change Video Resolution to 1024 /
768, any help would be great, thanks!! Tag: compile the code. Tag: 145663
script to join win2k computer to domain
Hello,
I need a script to join computer to domain. All the workstations are win2k
Thanks
Eimis Tag: compile the code. Tag: 145659
open a full screen IE window
Hi,
I want to open an IE window in full screen mode but with the same interface
that when we strike the F11 key.
Any idea ?
Thanks. Tag: compile the code. Tag: 145654
Ie as a Logon Screen Window
I'm experimenting with IE as a Loginscreen window.
I can get text to populate the window, but if I run past the size of the
window, the output is put at the bottom of the window, and the bar on the
right becomes active.
If you run the script below, you will see what I mean.
is there any way to:
A.) make the bottom lines of the screen active, so they're not printed off
of the active area?
or
B.) Make the top lines of the display scroll off the top.
'SCRIPT:
Set IE = CreateObject("InternetExplorer.Application")
ie.width=450
ie.height=450
ie.top=5
ie.left=150
ie.menubar=0
ie.statusbar=true
ie.resizable=false
ie.toolbar=0
ie.navigate ("About:blank")
ie.visible=1
ie.Document.title="Network Logon Script"
ie.Document.Body.topmargin=5
ie.Document.Body.leftmargin=5
For I = 1 to 40
Display("Line# "&I)
Next
Function Display(text)
ie.Document.Body.InsertAdjacentHTML "beforeEnd","<font face=Tahoma
color=#000066 size=2> "&text&"</font><br>"
End Function Tag: compile the code. Tag: 145652
OLD DOMAIN CONTROLLER
I have not idea why SPROCKETS in everywhere in on the workstations. But is
use to be the old domain controllers name. It seems like the Administrator
that worked there before manully mapped everything on the workstations. So
when I did do the Migration it kept the name in the registry and when user
NetMon to view the network traffice I could see that the workstation that
still had old domain controller's name in the registry are still trying to
communitcate with it and cause traffice on the network. Tag: compile the code. Tag: 145650
Type mismatch w/ when array values set as RegExp
Overview:
I need to compare values entered into a form against database values
to check for any type of duplicate text. I setup a javascript
function to take the value of my text boxes and remove any non-text
characters ie. /\W/ and set the value of a hidden field to the
returned string.
My plan is to compare the hidden field values to the database values
using vbscript whereby I set up an array that stores the database
records and then processes them through another function to remove
non-text characters.
Problem:
When I try to execute the vbscript function and pass the array data to
it, the page returns a returns a "type mismatch" error. I tried
setting the array value to a variable in this version of the code but
it doesn't seem to make any difference.
Thanks in advance!
-----The vbscript-----
'Replaces non-text
dim objRegExpr
Function stringMatchVB(strValue)
Set objRegExpr = New RegExp
objRegExpr.Pattern = "\W"
objRegExpr.Global = True
objRegExpr.IgnoreCase = True
stringMatchVB = objRegExpr.Replace(strValue, "")
Set objRegExpr = Nothing
End Function
dim dbTextArray()
dim arTable
dim tCols, tRows
dim tmpString
dim x, y, z
if vEOF="true" then
'Enter table values into an array
arTable = adoRS.GetRows()
adoRS.Close
'Find the number of records returned
tCols = UBound(arTable, 1)
tRows = UBound(arTable, 2)
'Array loop to search for matching values
For x = 0 to tRows
response.write("<br>")
For y = 1 to tCols
z = 0
REDIM PRESERVE dbTextArray(z, x)
tmpString = artable(y, x)
dbTextArray(z, x) = stringMatchVB(tmpString)
response.write(dbTextArray(z, x))
'response.write(artable(y, x))
response.write(" ")
'if arTable(y,x) = adoRS("SurveyQuestionID") then
'end if
z = z + 1
Next
Next
end if Tag: compile the code. Tag: 145647
Help with mailer script!
It's officaially time for me to stop and ask for directions! FYI I'm new
to VBscript and aim to create scripts to automate some of the things i
wish to do.
Heres my current task.
I need to test a spam filter using content contained in about 2000
seperate .txt files. I have successfully gotten my script to work with
the first txt file. But I have NO idea how to make the script process
each txt file into a seperate outgoing email.
Here's the code:
------------------------------------------------------------------
----------
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
("spamfile1.txt", ForReading)
strResponses = objTextFile.ReadAll
Set objEmail = CreateObject("CDO.Message")
objEmail.From = InputBox( "Type a senders address for spam here" )
objEmail.To = InputBox( "Type Target email address for spam here" )
objEmail.Subject = "Spam filter test"
objEmail.Textbody = strResponses
objEmail.Send
MsgBox "Your SPAM has been sent to " & _
objEmail.To
objTextFile.close
------------------------------------------------------------------------
------------
As you can see the current script is setup to only process 1 txt file
and 1 email. Again my goal is for the script to process each text file
(2000 of them) and then generate 2000 seperate emails which i will
direct at my content filter for testing.
Any help would e GREATLY appreciated and I apologize in advance if I
have asked a completely rudementary question. I am testing this for a
school that I volunteer IT time for so it is a non profit objective.
Thx again-
--
Posted via http://dbforums.com Tag: compile the code. Tag: 145644
Transfer a data or form post from window2window
Hello,
The problem is;
there are some data that i have to transfer from a window
to a window.
If one of this window is an opener, how must the code is
and how if they are not related windows.
Thank you
caglaror
Note: Ofcourse the language is vbs (or sometthing like
dhtml) Tag: compile the code. Tag: 145637
stuck building this array
Here is what I need to do, take dates queried from sql and
only display distinct dates plus the number
of times that date value appears. For instance the first
record date is 10/21/2003 and the next record is a later
date, so what would be
displayed is "1 on 10/21/2003", the next row takes the
next date e.g. 10/24/2003, but the following record is
also 10/24/2003, so
I would display "2 on 10/24/2003", and then move past the
duplicate to the next distinct date.
I'm not having much luck creating a solution. I thought
about creating child arrays for each set of dates, but
this list could potentially
be as large as several hundred records or more which would
probably start to affect server memory. Anyone have any
ideas? Tag: compile the code. Tag: 145633
ICA Client in ASP
Hi,
Can somebody point me to ICA Client examples and/or documents in ASP.
<%
set ct = server.CreateObject("Citrix.ICAClient.2.3")
%>
Thank You.
- Reena Tag: compile the code. Tag: 145630
Enumerate registry on remote computers?
Hi all,
The following works great on a local machine, however when I change the "."
to "Servername" The EnumKey fails. How can I enumerate on remote
computers?On Error Resume Next
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Services\WMI"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
WScript.Echo subkey
Next
Thanks in advance. Tag: compile the code. Tag: 145621
Uninstalling Netware
I'm trying to write a vb script that will uninstall the Netware client and
IPX from Windows 2000 workstations - then I'll push it out via SMS.
Does anyone know if this is possible. Is there a vb/wsh api to remove
clients and protocols from Windows 2000?
Is there another way to do this?
Thanks for any help
Andy Tag: compile the code. Tag: 145620
Wmi Install frozen under WinNT
Hello all,
sorry for cross-posting.
I tried several times to install WMI under NT. I downloaded this file:
http://www.microsoft.com/downloads/details.aspx?FamilyID=c174cfb1-ef67-471d-9277-4c2b1014a31e&DisplayLang=en
After starting the setup, I get this box:
"WMI Core Components Setup has detected an existing WMI installation of
the same version. Would you like to continue with this installation anyway?"
I answered "Yes", clicked through the wizard and chose "Reinstall Wmi
Core Components". After that the installer runs until a box with
"Configuring repository file format... Please wait" appears.
Her I can wait several hours, but nothings happens anymore.
I deleted all files unter "c:\Winnt\system32\wbem" an tried again, but
that did not help.
Can anybody help me, to solve this problem?
Thank you in advance.
Greetz, Stephan Tag: compile the code. Tag: 145615
IE Settings
I've written a small script to turn the proxy settings
on/off but I can't find out how to uncheck
the 'Automatically detect settings' check box. I've
searched through the registery but I can't find where
it's set.
I have found the rest of the settings, Proxy etc, just
not this one!
Any ideas? Tag: compile the code. Tag: 145613
MASS REGISTRY CHANGES
Hi Everyone;
I require some assistant. I have 400 workstations that require some
registry changes and every workstation is different. I am looking for and
Key, SUBKEY or Value of a Key with entry called SPROCKETS. By the way the
enviroment is all Windows2000. I thought about using Group Policies but
that would not work because the Keys could be different from one machine to
another. So my question is how can I automate the search and delete of
registry using scripts?? Tag: compile the code. Tag: 145612
sendto
hi,
don't know if its script issue but i'd like to set my script so i can have
it in the windows 'sendto' folder and when i say send a text file to the
script it will go to work on it.
anyone know?
thanks,
Luke Tag: compile the code. Tag: 145610
Trim and Trim$
Hi
As far I know (may be I am wrong), different between Trim and Trim$ is Trim$
works in binary format and that's way it is fast.
If this is true then we still people are still using Trim not the Trim$? Is
there any reason ?
MrBug Tag: compile the code. Tag: 145607
My Script to run a Command-Line from ASP does not work.
Hi,
My Script to run a Command-Line from ASP does not work. No errors are
returned either.
It is on IIS. The directory where the script exists is on Drive I:, The
executable .exe is on Drive D:
Do you see any problems with the script below? Can you help me modify it?
<%
Dim objWSS
Const cCMD = "clw45.exe -i k:\o\1.wmv -o k:\o\2.ghh -w 128 -df 0 -m
2 -p"
Set objWSS = CreateObject("WScript.Shell")
objWSS.CurrentDirectory = "D:\Program Files\Program\The Program\"
objWSS.Run "%COMSPEC% /c " & cCMD,,True
%>
Thank you very much for your help.
Lucas Tag: compile the code. Tag: 145591
Multiprocessor CPU Usage script
In a multiprocessor (8 way or 16 way) running Win 2K, I
need to determine (say via sampling thru' a script) for
each CPU, the CPU usage by each service, or conversely,
for each service/process the CPU time it consumed from
each CPU. Any ideas? Tag: compile the code. Tag: 145583
Using IISWeb.vbs
I'm attempting to use the IISWeb.vbs script on Server 2003 IIS6 to automate
creating web sites. I have my own .vbs file, and the simple command:
IIsWeb /query
Yields the following error:
Windows Script Host
Script: C:\Windows\system32\_IISWebCreate.vbs
Line: 1
Char: 8
Error: Syntax error
Code 800A03EA
Source: Microsoft VBScript compilation error
I'm running this as administrator in the System32 folder itself... Am I
missing something fundamental here, or is there some feature that I need to
cut on? Tag: compile the code. Tag: 145582
what's wrong ? (regular expression - vbscript)
I probed 5.5 and 5.6 versions and the script showed 0
matches, but I think all is right and the number of
matches would be 1
what's wrong ?
tia
<%@ LANGUAGE=VBScript %>
<%
num = "279"
Set regEx = New RegExp
regEx.Pattern = "/\d{1,3}/"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(num)
response.write("matches=" & Matches.Count
& "<br>")
Set regEx = Nothing
%> Tag: compile the code. Tag: 145576
Problem while sorting with Recordset
I use the following script to return folders on remote machines sorted
by size. Most times it works fine, but sometimes the size of the largest
folder (maybe around 5 gb) is returned as 0.
If I list the files sizes without sorting them, the size shows up fine.
So the problem is while sorting.
Does anyone have any idea why this happens? Thanks.
On Error Resume Next
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set sRootDir = oFSO.GetFolder("\\strComputer\c$\")
Const adInteger = 3
Const adVarChar = 200
Const MaxCharacters = 255
Set DataList = CreateObject("ADODB.Recordset")
DataList.Fields.Append "FName", adVarChar, MaxCharacters
DataList.Fields.Append "FSize", adInteger
DataList.Open
Set sSubDirs = sRootDir.SubFolders
For Each sDir In sSubDirs
DataList.AddNew
DataList("FName") = sDir.Path
DataList("FSize") = sDir.Size
DataList.Update
Next
DataList.Sort = "FSize DESC"
DataList.MoveFirst
Do Until DataList.EOF
WScript.Echo ConvBytes(DataList.Fields.Item("FSize")) & vbTAB & vbTAB
& DataList.Fields.Item("FName")
DataList.MoveNext
Loop
Public Function ConvBytes(SizeInBytes)
If isNumeric(SizeInBytes) Then
If Int(SizeInBytes) < 1000 Then
ConvBytes = Round(Int(SizeInBytes),2) & " bytes"
ElseIf Int(SizeInBytes) < 1000000 Then
ConvBytes = Round((Int(SizeInBytes)/1024),2) & " KB"
ElseIf Int(SizeInBytes) < 1000000000 Then
ConvBytes = Round((Int(SizeInBytes)/1048576),2) & " MB"
ElseIf Int(SizeInBytes) < 1000000000000 Then
ConvBytes = Round((Int(SizeInBytes)/1073741824),2) & " GB"
End If
End If
End Function
--
Posted via http://dbforums.com Tag: compile the code. Tag: 145575
wish request
This is a multi-part message in MIME format.
------=_NextPart_000_0008_01C398A5.83673230
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Would it be possible to implement block commenting for vb and vbScript? =
I am finding it rather cumbersome to be placing single quotes (') at the =
beginning of each line I wish to comment... I would be nice to use:
/*=20
commented lines
commented lines
*/
Mike
------=_NextPart_000_0008_01C398A5.83673230
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.2800.1264" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Would it be possible to implement block commenting =
for vb and=20
vbScript? </FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>I am finding it rather cumbersome to be placing =
single quotes=20
(') at the beginning of each line I wish to comment... I would be nice =
to=20
use:</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>/* </FONT></DIV>
<DIV><FONT size=3D2>
<DIV><FONT size=3D2>commented lines
<DIV><FONT size=3D2>commented lines</FONT></DIV>
<DIV><FONT size=3D2>*/</FONT></DIV>
<DIV> </DIV>
<DIV>Mike</DIV></FONT></DIV></FONT></DIV></BODY></HTML>
------=_NextPart_000_0008_01C398A5.83673230-- Tag: compile the code. Tag: 145568
Using ADSI to get info from AD
I have an Active Directory with several different OUs containing user
accounts. I am trying to write a script to get the email address of any
user. I would like the only info going into the script to be the
username, because it will not know what OU any given user is in.
All the binding examples I have seen require you to specify the OU or
group name. How can I bind to an object if I don?t know where it is?
--
Posted via http://dbforums.com Tag: compile the code. Tag: 145567
Inventory Script
I'm part of a small firm that is growing rapidly. I'm
looking to write a script that will inventory all of the
computers on our Windows 2000 network. The information
that I would like to capture would be the name and IP of
each machine on the network, the count of the machines on
the network, the number of processors for a giving machine,
and the number of monitors attatched to each machine. I
know how to get this information for a single, specified
computer, but I don't know how to iterate through all of
the computers on the network. I'd also like it to
atomatically discover any new systems that are put on the
network, as well as any changes to the name, IP, etc.
Thanks in advance,
Draft Tag: compile the code. Tag: 145566
VBScript for updating Terminal Server settings in AD
Hello,
I need to update about 5000 user id's in a Windows 2000
Active Directory with Terminal Server settings.
These settings are:
Terminal Server Profile Path
Terminal Server Home Directory
Terminal Server Home Drive
Allow logon to terminal server
Create the Home Directory and set the appropriate
permissions. I have found several references to this on
the script site but nothing complete. We would like to be
able to feed the script a list of names to complete. I am
very new to scripting so if you have a document or a
sample script I could look at that would be very helpful.
Thanks Randy Becker Tag: compile the code. Tag: 145565
Adding users to a group
Is there a way to add all users in a particular OU to a ditribution list
using a script... any help would be appreciated.
Thanks
Gavin... Tag: compile the code. Tag: 145559
Limitations to WshShell.Run?
Can anyone tell me if there are limitations to length of characters
that WshShell.Run can handle. The reason I ask is that when I run a
script to CAb log files during the script I used a variable that
stores basically a list of files that meet a certain criteria of days
old and have no found out that if there are too many files listed it
apparently gives a permission denied error. SO I was just wondering
if there were any limitations on that and if so what they were.
Obviously there are some kind of limitations, because I change the
criteria of days to look for and have it find less files to put in the
list and it works fine.
Chris Tag: compile the code. Tag: 145557
Java won't reinstall
I had a bunch of parasites on my machine, tons of
unwanted popup ads, that Ad-Aware seems to have removed.
However, I had an error message at startup that Java (Sun
version) was missing a library and couldn't run. I
uninstalled Java, went back to Sun's website, and now it
won't reinstall. Any suggestions? Tag: compile the code. Tag: 145555
How to share a printer
Hello!
I want to share a local printer from a Terminal server session with a vbs
script.
Please help, I'm a real newbie to scripting.
Here is the part of my script that doesn't work... ;)
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer Where Name = 'PrinterName'")
For Each objPrinter in colInstalledPrinters
objPrinter.Shared = True
objPrinter.ShareName = Sharename
objPrinter.Put_
Next
I have the name of the printer in a variable and I want to put it in
'PrinterName' in ("Select * from Win32_Printer Where Name = 'PrinterName'")
I have a Win2003 box.
Many thanks.
Jesper Tag: compile the code. Tag: 145549
Help with File System Object
I am presently pulling information from a specific text file that has to be
on a floppy (don't ask why...I gave up asking why a long time ago).
The application takes the info from the file stores it in a session array
and all is good from there.
I'm trying to figure a 'nice' way of error trapping and alerting the user
that he hasn't put the disk in or that the file isn't there etc.
I have limited experience with the FileSystemObject so that's why I'm
turning here.
I'd like to alert the user that they have not yet put the disk in and not
let them go on until the correct disk with the correct file is in their
drive.
Anyone have any similar code or can point me in a good direction?
Pejo Tag: compile the code. Tag: 145544
wmi scriptomatic - run time error at line 90
Apologies for any cross posting.
I'm having trouble with scriptomatic on my XP Pro box.
I run "scriptomatic.hta" and get a very small window (title bar only)
and then get this error in a dialog:
Line: 90
Char: 4
Error: The object invoked has disconnect from its clients.
Code: 0
URL: file://C:\Documents and Settings\msabia\Local
Settings\Temp\scriptomatic.hta
Do you wan to continue running scripts on this page?
The window never becomes populated. If I maximize the window, I get
the 4 buttons but no pull down.
I've tried some of the other posted solutions for problems with
scriptomatic, but they don't seem to help.
I have no pop-up blocker running. It works fine on another XP Pro box
(which I don't have regular access to)
Any ideas?
Thank you!
Mike Sabia
(add a "2" to my email address for direct communication, if desired) Tag: compile the code. Tag: 145543
Hyper Link to script
All:
I have a Visio network diagram and I want to add a link to a VBS script.
I save the drawing as html, but wehen I click the link onb the web page,
it opens to a blank page.
Here is the address for the link: \\rwoca3\it_web\wscript
access_excel.vbs
Suggestions how to get this working?
--
Posted via http://dbforums.com Tag: compile the code. Tag: 145542
Script within script - nesting scripts
How do I invoke a vbscript from within a vbscript. For
example: I have Main.vbs, One.vbs, and Two.vbs. I would
like Main.vbs to invoke first One.vbs and then Two.vbs.
What's the right way to do this? Tag: compile the code. Tag: 145533
Getting info from a Registry Entry.
Hey People,
Here's the situation, I have made a VB script regarding some profile
relative settings on a client. However we thought it might be
interesting to get the script only to run if a surten entry on the
registry is 1.1 for instance.
so basically I made a key under HKCU/Software/Companyname/Profile "0"
So Default the key would be zero. Now when Im in the VB script I cant
seem to find a way to get that actual key into an IF construction.
so this is what I want: IF registryentry is 0 THEN Run script and at
the end create registry entry 1.1 (the creating an entry inst a
problem), and with that a line IF registryentry is 1.1 THEN stop te
script all together..
Can someone help me out here.. thnx in advance! Tag: compile the code. Tag: 145532
VBScript to search external LDAP
I am trying to write a VBScript that will search an external UNIX
directory based on a person's last name and first name.
I currently have a script that can search for the user's login id and
give me the first and last name:
--Begin Script--
CONST ADS_NO_AUTHENTICATION = &H0010
CONST ADS_SERVER_BIND = &H0200
sLDAPsrv = "ldap.server.edu"
sLDAPsb = "ou=people,o=server.edu"
sCN = InputBox("Enter UNIX ID:")
sRoot = "LDAP://" & sLDAPsrv & "/uid=" & sCN & "," & sLDAPsb
sDN = "cn=" & sCN & "," & sLDAPsb
Set oDSP = GetObject("LDAP:")
Set oUser = oDSP.OpenDSObject(sRoot,vbNullString,vbNullString,ADS_SERVER_BIND
AND ADS_NO_AUTHENTICATION)
oUser.GetInfo
strName = oUser.givenName
strLast = oUser.sn
MsgBox strName
MsgBox strLast
wscript.Quit
--End Script--
That works great, but I am unable to determine how to search for the
last and first name using the same methods and get the uid. I have
searched everywhere I can think, but most of what I find is either
exclusive to AD or exclusive to UNIX.
Help?
Thanks in advance,
Dan Tag: compile the code. Tag: 145530
IE Proxy setting script for a nOOb please!!
HELP I am new to the Win 2K server and need to set the proxy in the client
machines (XP). I have been doing it handraulically and it takes time and
dosnt set it for the users just the admin. I work volunteer in a small
school, my main work is electronics tech so I am in over my head. Please
help me...btw I am going back to school to learn networking so one day I
might be able help here.
TIA Michael Tag: compile the code. Tag: 145522
Script for Copying profile
Hello,
We created script to upgrade pc to winxp and automatically add it to new
domain, now we need to figure out how to copy old users profile to new one.
Any ideas ?
Thank you
Eimis Tag: compile the code. Tag: 145520
Capturing IE window content to text file
I have a web page that displays statistics which I would like to
periodically save. If I open the web page and hit CTRL+A to highlight the
text and then copy and paste it to a text document I get exactly what I
want. However, I would like to automate this with a vbscript. Can anyone
give me some idea of how to do this?
Thank you.
Ralph Tag: compile the code. Tag: 145519
Monitor Registry Entry Level Events
Hey all
Im trying to monitor a registry key HKEY_CURRENT_USER\Control Panel\Desktop
to find when a user is changing the wallpaper (win 2000 network).
Can someone tell me whats wrong with this script?
The script was taken from microsoft and modified to my needs.
1. can i monitor HKEY_CURRENT_USER???
2. the script is returns an error - "invalid query"
***********************************
Original script
Set wmiServices = GetObject("winmgmts:root/default")
Set wmiSink = WScript.CreateObject("WbemScripting.SWbemSink", "SINK_")
wmiServices.ExecNotificationQueryAsync wmiSink, _
"SELECT * FROM RegistryValueChangeEvent WHERE Hive='HKEY_LOCAL_MACHINE'
AND " & _
"KeyPath='SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion' AND
ValueName='CSDVersion'"
WScript.Echo "Listening for Registry Change Events..." & vbCrLf
While(1)
WScript.Sleep 1000
Wend
Sub SINK_OnObjectReady(wmiObject, wmiAsyncContext)
WScript.Echo "Received Registry Change Event" & vbCrLf & _
"------------------------------" & vbCrLf & _
wmiObject.GetObjectText_()
End Sub
***********************************My script
Set wmiServices = GetObject("winmgmts:root/default")
Set wmiSink = WScript.CreateObject("WbemScripting.SWbemSink", "SINK_")
wmiServices.ExecNotificationQueryAsync wmiSink, _
"SELECT * FROM RegistryValueChangeEvent WHERE Hive='HKEY_CURRENT_USER'
AND " & _
"KeyPath='Control Panel\\Desktop' AND ValueName='Wallpaper'"
WScript.Echo "Listening for Registry Change Events..." & vbCrLf
While(1)
WScript.Sleep 1000
Wend
Sub SINK_OnObjectReady(wmiObject, wmiAsyncContext)
WScript.Echo "Received Registry Change Event" & vbCrLf & _
"------------------------------" & vbCrLf & _
wmiObject.GetObjectText_()
End Sub
*********************************** Thanks,
ITman Tag: compile the code. Tag: 145516
RUN/execute a Command-Line command from an ASP page.
Hi,
I need to RUN/execute a Command-Line command from an ASP page.
This is the command:
sse45.exe -i k:\o\2.wmv -o k:\o\2.shh -w 128 -df 0 -m 2 -p
Can you show me a code how to run this command from an ASP page? I need to
run it from an ASP/VBscript?
Thank you very much for your help! Tag: compile the code. Tag: 145513
Select variable "column name"
I'm having this code in VBscript and I want to select a column name
which is variable.
<%@Language="VBScript"%>
<%
Link = Request.QueryString("link")
oRS.Open "SELECT 'Link' FROM snowzone", oConn, 2, 3
%>
How should the SELECT statement be written correctly? Tag: compile the code. Tag: 145510
Spaces and parameters query for VB Script
Hi all -
I need to run an application off a shared network drive. I am
having problems with writing the script that will access the network
drive (since I need to specify parameters and the network drive name
has a space in it). I have no problems running it off the command
line, but with the spaces and quotes in VBScript, things get messed
up.
I need to run this line with VB Script, anyone with any ideas ?
(All on one line)
\\Software share\Clients\W32Intel\Setup.exe -s -f1
\\Software share\Clients\W32Intel\setup.iss"
I'm looking for something like this :
set ws = wscript.createobject("wscript.shell")
ws.run("\\Software share\Clients\W32Intel\Setup.exe -s -f1 ... etc")
I have tried several combinations of """, "", and " with no luck :-)
Thanks for your help. Tag: compile the code. Tag: 145497
If I do not want the users to read the code, how can I do
it.