lair360
-
Total Posts
:
24
- Scores: 0
-
Reward points
:
0
- Joined: 5/16/2008
-
Status: offline
|
Why my VBS code book is so dumb! This code can't work properly!!
Tuesday, May 20, 2008 11:13 AM
( permalink)
I've tried to fix this VBScript and it still give me errors! Anything wrong here???
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & _
"\root\MicrosoftDNS")
Set colItems = objWMIService.ExecQuery("Select * From MicrosoftDNS_Cache")
For Each objItem in colItems
objItem.ClearCache()
Next
P.S. This script is very usefull and I need it alot! But, it doesn't bloody work!!
|
|
|
|
lair360
-
Total Posts
:
24
- Scores: 0
-
Reward points
:
0
- Joined: 5/16/2008
-
Status: offline
|
RE: Why my VBS code book is so dumb! This code can't work properly!!
Tuesday, May 20, 2008 11:42 AM
( permalink)
Microsoft is dumb as hell! This also goes to Xbox and their junk!! The code should be like this!!
'---------------------------------------
'Author: Lair360
'Version: 46 Build 243
'---------------------------------------
Option Explicit
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "cmd /k e: & ipconfig /flushdns"
WScript.Quit
' End of VBScript command
P.S. Their VBS codes learning centre are lame! Mostly....
|
|
|
|
TNO
-
Total Posts
:
2094
- Scores: 36
-
Reward points
:
0
- Joined: 12/18/2004
- Location: Earth
-
Status: offline
|
RE: Why my VBS code book is so dumb! This code can't work properly!!
Tuesday, May 20, 2008 1:11 PM
( permalink)
Is not working because Windows Server 2008, Windows Server 2003, or Windows 2000 Server is required. this doesn't exist on other OSes I believe. ORIGINAL: lair360 I've tried to fix this VBScript and it still give me errors! Anything wrong here???
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & _
"\root\MicrosoftDNS")
Set colItems = objWMIService.ExecQuery("Select * From MicrosoftDNS_Cache")
For Each objItem in colItems
objItem.ClearCache()
Next
P.S. This script is very usefull and I need it alot! But, it doesn't bloody work!!
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
|
|
dm_4ever
-
Total Posts
:
3687
- Scores: 82
-
Reward points
:
0
- Joined: 6/29/2006
- Location: Orange County, California
-
Status: offline
|
RE: Why my VBS code book is so dumb! This code can't work properly!!
Wednesday, May 21, 2008 1:24 AM
( permalink)
|
|
|
|
lair360
-
Total Posts
:
24
- Scores: 0
-
Reward points
:
0
- Joined: 5/16/2008
-
Status: offline
|
RE: Why my VBS code book is so dumb! This code can't work properly!!
Wednesday, May 21, 2008 3:34 AM
( permalink)
Ahhh...somehow my visual basic book doesn't state types of OS compatibility. Thank you very admin and everyone! T.T I'm already crying...this forum is my favourite! All of you guys are fan of VBS club!
|
|
|
|
TNO
-
Total Posts
:
2094
- Scores: 36
-
Reward points
:
0
- Joined: 12/18/2004
- Location: Earth
-
Status: offline
|
RE: Why my VBS code book is so dumb! This code can't work properly!!
Wednesday, May 21, 2008 3:59 AM
( permalink)
THe safest bet to know wheter a WMI will work is if it has Win32_ in front of it. Otherwise you may want to check up on it
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
|
|
lair360
-
Total Posts
:
24
- Scores: 0
-
Reward points
:
0
- Joined: 5/16/2008
-
Status: offline
|
RE: Why my VBS code book is so dumb! This code can't work properly!!
Wednesday, May 21, 2008 6:12 AM
( permalink)
Thanks for the advice, I'll put your infos to my notepad for further usesage.
|
|
|
|