windows xp media centre

C

Capitan

Anyone know of a script which will allow you to set
someone's homepage in IE? Is there a way to do it with a
script that can run only in the current profile and not
need admin access to succeed? Thanks!
 
C

Capitan

Sorry I sent this to windowsxp.general on accident.
Please disregard in that group.
 
Y

y sakuda

Capitan said:
Sorry I sent this to windowsxp.general on accident.
Please disregard in that group.
I'm not sure what do you mean "set someone's homepage to IE"
You can change IE's Start Page with this script.

Dim WS, wHpURL, wRtn
Set WS = CreateObject("wscript.shell")
wHpURL ="http://www.yahoo.com/"
' for HomePage
WS.RegWrite "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page", _
wHpURL,"REG_SZ"
' for Standard HomePage
WS.RegWrite "HKLM\Software\Microsoft\Internet Explorer\Main\Default_Page_URL", _
wHpURL, "REG_SZ"
Set WS=Nothing

Y Sakuda from JPN
 
T

Type mismatch

Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'System'
and " _& "EventCode = '6005'" or "EventCode = '6006'")

For some reason on the above snipet of code I get a type
mismatch error, specifically on

"Select * from Win32_"

I understand a type mismatch is an error that commonly
comes from trying to compare 2 different kinds of data such
as text and numeric, but I don't understand why I'm getting
it here? Any helpful suggestions welcome. TIA!
 
T

Type mismatch

I was wondering if anyone has any suggestions on how I
might go about composing a vbscript that could take screen
shots every minute, or few minutes on a machine without a
user knowing it's doing so. Before anyone gets the wrong
idea that I might misuse this, my intentions are for
monitoring my son's activites on the computer and internet.
TIA for any help!
 
C

Carey Frisch [MVP]

Consider installing a first-rate internet security program which
includes "Parental Controls", allowing you to become proactive
rather than "reactive" and "confrontational".

Norton Internet Security 2005
http://www.symantec.com/sabu/nis/nis_pe/

-- Includes Norton AntiVirus 2004
-- Includes Norton Personal Firewall
-- Includes prevention of annoying web pop-ups
-- Includes Parental Controls
-- All in one, easy-to-install package

--
Carey Frisch
Microsoft MVP
Windows XP - Shell/User

Be Smart! Protect Your PC!
http://www.microsoft.com/athome/security/protect/default.aspx

------------------------------------------------------------------------------

:

| I was wondering if anyone has any suggestions on how I
| might go about composing a vbscript that could take screen
| shots every minute, or few minutes on a machine without a
| user knowing it's doing so. Before anyone gets the wrong
| idea that I might misuse this, my intentions are for
| monitoring my son's activites on the computer and internet.
| TIA for any help!
 
M

Michael Harris \(MVP\)

Type said:
Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'System'
and " _& "EventCode = '6005'" or "EventCode = '6006'")

You have some extraneous "s around the or in the last line, so VBScript is
trying to Or 2 string literals together which throws a type mismatch error.

Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'System' and " _
& "EventCode = '6005'" or "EventCode = '6006'")

It should be...

Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'System' and " _
& "EventCode = '6005' or EventCode = '6006'")
 
T

Type mismatch

Thanks for the response. It works great now!

-----Original Message-----
You have some extraneous "s around the or in the last line,
so VBScript is
trying to Or 2 string literals together which throws a type
mismatch error.

Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'System'
and " _
& "EventCode = '6005'" or "EventCode = '6006'")

It should be...

Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'System'
and " _
& "EventCode = '6005' or EventCode = '6006'")


-- Michael Harris Microsoft.MVP.Scripting Sammamish WA US
 
C

Capitan

I found this snipit of script online searching the
newsgroups, and for some reason I get an access denied
error on the following line when running it as the local
admin on an XP pro machine.

objFSO.DeleteFile("c:\Documents and Settings\" &
strUsername & "\Local Settings\Temp\*.*"), DeleteReadOnly

Why would I be able to delete files in here manually, but
my script be denied access? Thanks in advance for any
help.
 
G

Gord Dibben

Sure wish I had you for a Dad.

"Get the wrong idea that I might misuse this"!!!

Secretly spying on another person(yes, your son is a person) is a misuse of
power as as I am concerned.

What happens when he finds out what you have done if you manage to get it
done?

Do you also read his mail and diary if he keeps one?

What's next? A P.I. to follow him when he's on a date?

A hidden camera in his bedroom in hopes of catching him pounding the pud?

Great values you are proposing to teach your son.

You can always hope he'll turn out OK inspite of your parenting style.

Gord
 
D

dlbjr

I would suggest a proxy server. I use a proxy server to separate my broadband from by private LAN.
All web traffic history is maintained with time and user constraints for each child member of the
family.

'dlbjr
'Pleading sagacious indoctrination!
 
G

Gerry Hickman

Type said:
idea that I might misuse this, my intentions are for
monitoring my son's activites on the computer and internet.

Spying on children IS a misuse. If you're in the US it's probably legal
but in the EU children have rights to privacy.

There's a gazillion providers that offer a "family filter" service that
provides a very safe browsing experience.
 
T

Type mismatch

Set objFS = CreateObject("Scripting.FileSystemObject")

'Open logfile. True means Overwrite any old file
Set objLogFile = objFS.CreateTextFile
("d:\watch\when_on.log", True)

'Write to log file
objLogFile.WriteLine("Log started at " & now() )

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer
& "\root\cimv2")

Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'System'
and " _
& "EventCode = '6005' or EventCode = '6006'")

for each objevent in colloggedevents

Dim wConvDate
Set wConvDate = CreateObject("WbemScripting.SWbemDateTime")
wConvDate.Value = objevent
wscript.echo wConvDate.GetVarDate
Set wConvDate = Nothing

objLogFile.WriteLine(objevent.timewritten & ": " &
objevent.message )
next

In the above script, I am having problems getting it to
convert the value of objevent to readable time and date.
I know that the line

wConvDate.Value = objevent

is wrong becuase this is where I get the error. I have
tried searching and have had no luck finding the answer.
Any suggestions? TIA!
 
D

David H. Lipman

For one, posting in microsoft.public.windowsxp.general


Dave







| Set objFS = CreateObject("Scripting.FileSystemObject")
|
| 'Open logfile. True means Overwrite any old file
| Set objLogFile = objFS.CreateTextFile
| ("d:\watch\when_on.log", True)
|
| 'Write to log file
| objLogFile.WriteLine("Log started at " & now() )
|
| strComputer = "."
| Set objWMIService = GetObject("winmgmts:" _
| & "{impersonationLevel=impersonate}!\\" & strComputer
| & "\root\cimv2")
|
| Set colLoggedEvents = objWMIService.ExecQuery _
| ("Select * from Win32_NTLogEvent Where Logfile = 'System'
| and " _
| & "EventCode = '6005' or EventCode = '6006'")
|
| for each objevent in colloggedevents
|
| Dim wConvDate
| Set wConvDate = CreateObject("WbemScripting.SWbemDateTime")
| wConvDate.Value = objevent
| wscript.echo wConvDate.GetVarDate
| Set wConvDate = Nothing
|
| objLogFile.WriteLine(objevent.timewritten & ": " &
| objevent.message )
| next
|
| In the above script, I am having problems getting it to
| convert the value of objevent to readable time and date.
| I know that the line
|
| wConvDate.Value = objevent
|
| is wrong becuase this is where I get the error. I have
| tried searching and have had no luck finding the answer.
| Any suggestions? TIA!
 
J

Jay

I'll assume the error is type mismatch as you've used it as your handle?
At first glance with sleepy eyes it appears you are trying to stuff an
object with a date/time value when the compiler thinks the object is of a
different type.
Debug!
Dim wConvDate
Set wConvDate = CreateObject("WbemScripting.SWbemDateTime")
if isDate(wConvDate) then
msgbox("Date! " & wConvDate)
else
msgBox("No date! " & wConvDate)
end if
 
D

Dave Patrick

This may help. Watch for linewrap.

Dim strConnect, strSQL, yr, m, d, h, min, s, timeobj
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=D:\Data\Access\Eventlog.mdb;" _
& "Mode=ReadWrite;Persist Security Info=False"
strSQL = "SELECT Category, ComputerName, EventCode, " _
& "Message, EventType, RecordNumber, SourceName, " _
& "Type, User, TimeGenerated, TimeWritten FROM EventTable; "

Set objConn = CreateObject("ADODB.Connection")
Set objRS = CreateObject("ADODB.Recordset")
objConn.Open strConnect
objRS.CursorLocation = 3
objRS.Open strSQL, objConn, 3, 3

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!" _
& "\\" & strComputer & "\root\cimv2")
Set colRetrievedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'System' and " _
& "EventCode = '6005' or EventCode = '6006'")

For Each objEvent in colRetrievedEvents
' If objEvent.SourceName = "PercRAID.Log" Then
objRS.AddNew
objRS("Category") = objEvent.Category
objRS("ComputerName") = objEvent.ComputerName
objRS("EventCode") = objEvent.EventCode
objRS("Message") = objEvent.Message
objRS("EventType") = objEvent.EventType
objRS("RecordNumber") = objEvent.RecordNumber
objRS("SourceName") = objEvent.SourceName
objRS("Type") = objEvent.Type
objRS("User") = objEvent.User
objRS("TimeGenerated") = DateTime2String(objEvent.TimeGenerated)
objRS("TimeWritten") = DateTime2String(objEvent.TimeWritten)
objRS.Update
' End If
Next
objRS.Close
objConn.Close
Function DateTime2String(timeobj)
yr = Left(timeobj,4)
m = Mid(timeobj,5,2)
d = Mid(timeobj,7,2)
h = Mid(timeobj,9,2)
min = Mid(timeobj,11,2)
s = Mid(timeobj,13,2)
DateTime2String = m & "/" & d & "/" & yr _
& " " & h & ":" & min & ":" & s
End Function


--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Set objFS = CreateObject("Scripting.FileSystemObject")
|
| 'Open logfile. True means Overwrite any old file
| Set objLogFile = objFS.CreateTextFile
| ("d:\watch\when_on.log", True)
|
| 'Write to log file
| objLogFile.WriteLine("Log started at " & now() )
|
| strComputer = "."
| Set objWMIService = GetObject("winmgmts:" _
| & "{impersonationLevel=impersonate}!\\" & strComputer
| & "\root\cimv2")
|
| Set colLoggedEvents = objWMIService.ExecQuery _
| ("Select * from Win32_NTLogEvent Where Logfile = 'System'
| and " _
| & "EventCode = '6005' or EventCode = '6006'")
|
| for each objevent in colloggedevents
|
| Dim wConvDate
| Set wConvDate = CreateObject("WbemScripting.SWbemDateTime")
| wConvDate.Value = objevent
| wscript.echo wConvDate.GetVarDate
| Set wConvDate = Nothing
|
| objLogFile.WriteLine(objevent.timewritten & ": " &
| objevent.message )
| next
|
| In the above script, I am having problems getting it to
| convert the value of objevent to readable time and date.
| I know that the line
|
| wConvDate.Value = objevent
|
| is wrong becuase this is where I get the error. I have
| tried searching and have had no luck finding the answer.
| Any suggestions? TIA!
 
Y

y sakuda

I supporse "objevent" is object and not string.
Please change
wConvDate.Value = objevent
to
wConvDate.Value = objevent.timewritten

y sakuda from JPN
 
T

Type mismatch

Script the print screen key like this with sendkeys?

WshShell.sendkeys "{PRTSC}"

I don't think it's working. I'm not sure if it is because
the command is wrong or because the application I want to
paste the print screen into isn't the active application.

Below is the script:

set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Sleep 100

WshShell.sendkeys "{PRTSC}"
WScript.Sleep 100

wshshell.run "mspaint"
WScript.Sleep 100

WshShell.sendkeys "^v"
WScript.Sleep 100

It opens mspaint, but does not paste the picture. Any
ideas?
-----Original Message-----
all you need to do is script the shift prnt scrn key.
But there are
commercial packages that will do what you want much better

http://www.track4win.com/

39.00 hard to beat free to try for 2 weeks

Wayne

"Type mismatch" <[email protected]>
wrote in message
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top