473,614 Members | 2,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Alternate Credentail

14 New Member
Hi
Is anyone here who can help me to get this scripts running under alternate credentials.... .............
Expand|Select|Wrap|Line Numbers
  1.  
  2. '''''''''''''''''''''''''''
  3.  
  4. '''''''''''''''''''''''''''
  5. ' Monitor EDID Information'
  6. strComputer  = Trim(inputbox("Enter name or IP address of local or remote computer"))
  7. Dim oDisplaySubKeys : Set oDisplaySubKeys = CreateObject("Scripting.Dictionary")
  8. Dim oRawEDID : Set oRawEDID = CreateObject("Scripting.Dictionary")
  9. Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
  10.  
  11. Int intMonitorCount=0
  12. Int intDisplaySubKeysCount=0
  13. Int i=0
  14.  
  15. Set oRegistry = GetObject("winmgmts:\\" & strComputer & "/root/default:StdRegProv")
  16. strDisplayBaseKey = "SYSTEM\CurrentControlSet\Enum\DISPLAY\"
  17.  
  18. ' Retrieving EISA-Id from HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY and storing in strarrDisplaySubKeys
  19. iRC = oRegistry.EnumKey(HKLM, strDisplayBaseKey, strarrDisplaySubKeys)
  20.  
  21. ' Deleting from strarrDisplaySubKeys "Default_Monitor" value
  22. For Each sKey In strarrDisplaySubKeys
  23.  
  24. If sKey ="Default_Monitor" Then
  25. intDisplaySubKeysCount=intDisplaySubKeysCount - 1
  26. Else
  27. oDisplaySubKeys.add sKey, intDisplaySubKeysCount
  28. End If
  29.  
  30. intDisplaySubKeysCount=intDisplaySubKeysCount + 1
  31.  
  32. Next
  33.  
  34. ' Storing result in oDisplaySubKeys
  35. strResultDisplaySubKeys=oDisplaySubKeys.Keys
  36.  
  37. toto=0
  38.  
  39. For i = 0 to oDisplaySubKeys.Count -1
  40.  
  41. strEisaIdBaseKey = strDisplayBaseKey & strResultDisplaySubKeys(i) & "\"
  42.  
  43. ' Retrieving Pnp-Id from HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\EISA-Id and storing in strarrEisaIdSubKeys
  44. iRC2 = oRegistry.EnumKey(HKLM, strEisaIdBaseKey, strarrEisaIdSubKeys)
  45.  
  46. For Each sKey2 In strarrEisaIdSubKeys
  47. oRegistry.GetMultiStringValue HKLM, strEisaIdBaseKey & sKey2 & "\", "HardwareID", sValue
  48.  
  49. For tmpctr=0 to ubound(svalue)
  50.  
  51. If lcase(Left(svalue(tmpctr),8))="monitor\" then
  52.  
  53. strMsIdBaseKey = strEisaIdBaseKey & sKey2 & "\"
  54.  
  55. iRC3 = oRegistry.EnumKey(HKLM, strMsIdBaseKey, strarrMsIdSubKeys)
  56.  
  57. For Each sKey3 In strarrMsIdSubKeys
  58.  
  59. If skey3="Control" then
  60.  
  61. toto=toto + 1
  62.  
  63. oRegistry.GetBinaryValue HKLM, strMsIdBaseKey & "Device Parameters\", "EDID", intarrEDID
  64.  
  65. strRawEDID=""
  66. strRawEDIDb=""
  67.  
  68. If vartype(intarrEDID) = 8204 then
  69.  
  70. For each strByteValue in intarrEDID
  71.  
  72. strRawEDID=strRawEDID & Chr(strByteValue)
  73. strRawEDIDb=strRawEDIDb & Chr(strByteValue)
  74.  
  75. Next
  76.  
  77. Else
  78.  
  79. strRawEDID="EDID Not Available"
  80.  
  81. End If
  82.  
  83.  
  84. oRawEDID.add intMonitorCount , strRawEDID
  85. intMonitorCount=intMonitorCount + 1
  86.  
  87. End If
  88. Next
  89. End If
  90. Next
  91. Next
  92. Next
  93.  
  94.  
  95.  
  96. 'now the EDID info For each active monitor is stored in an dictionnary of strings called oRawEDID
  97. 'so we can process it to get the good stuff out of it which we will store in a 5 dimensional array
  98. 'called arrMonitorInfo, the dimensions are as follows:
  99. '0=VESA Mfg ID, 1=VESA Device ID, 2=MFG Date (M/YYYY),3=Serial Num (If available),4=Model Descriptor
  100.  
  101.  
  102. strResultRawEDID=oRawEDID.Keys
  103.  
  104. dim arrMonitorInfo()
  105. redim arrMonitorInfo(intMonitorCount-1,5)
  106. dim location(3)
  107.  
  108.  
  109.  
  110. For i=0 to oRawEDID.Count - 1
  111.  
  112. If oRawEDID(i) <> "EDID Not Available" then
  113.  
  114.  
  115.  
  116. location(0)=mid(oRawEDID(i),&H36+1,18)
  117. location(1)=mid(oRawEDID(i),&H48+1,18)
  118. location(2)=mid(oRawEDID(i),&H5a+1,18)
  119. location(3)=mid(oRawEDID(i),&H6c+1,18)
  120.  
  121.  
  122. strSerFind=Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&Hff)
  123.  
  124.  
  125. strMdlFind=Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&Hfc)
  126.  
  127. intSerFoundAt=-1
  128. intMdlFoundAt=-1
  129.  
  130. For findit = 0 to 3
  131. If instr(location(findit),strSerFind)>0 then
  132.  
  133. intSerFoundAt=findit
  134.  
  135. End If
  136.  
  137. If instr(location(findit),strMdlFind)>0 then
  138.  
  139. intMdlFoundAt=findit
  140.  
  141. End If
  142.  
  143. Next
  144.  
  145. 'If a location containing a serial number block was found then store it
  146. If intSerFoundAt<>-1 then
  147.  
  148. tmp=Right(location(intSerFoundAt),14)
  149.  
  150. If instr(tmp,Chr(&H0a))>0 then
  151.  
  152. tmpser=Trim(Left(tmp,instr(tmp,Chr(&H0a))-1))
  153.  
  154. Else
  155.  
  156. tmpser=Trim(tmp)
  157.  
  158. End If
  159.  
  160.  
  161. If Left(tmpser,1)=Chr(0) then tmpser=Right(tmpser,Len(tmpser)-1)
  162.  
  163. Else
  164.  
  165. tmpser="Serial Number Not Found in EDID data"
  166.  
  167. End If
  168.  
  169. 'If a location containing a model number block was found then store it
  170. If intMdlFoundAt<>-1 then
  171.  
  172. tmp=Right(location(intMdlFoundAt),14)
  173.  
  174. If instr(tmp,Chr(&H0a))>0 then
  175.  
  176. tmpmdl=Trim(Left(tmp,instr(tmp,Chr(&H0a))-1))
  177.  
  178. Else
  179.  
  180. tmpmdl=Trim(tmp)
  181.  
  182. End If
  183.  
  184.  
  185. If Left(tmpmdl,1)=Chr(0) then tmpmdl=Right(tmpmdl,Len(tmpmdl)-1)
  186.  
  187. Else
  188.  
  189. tmpmdl="Model Descriptor Not Found in EDID data"
  190.  
  191. End If
  192.  
  193. tmpmfgweek=Asc(mid(oRawEDID(i),&H10+1,1))
  194.  
  195.  
  196. tmpmfgyear=(Asc(mid(oRawEDID(i),&H11+1,1)))+1990
  197.  
  198.  
  199. tmpmdt=month(dateadd("ww",tmpmfgweek,DateValue("1/1/" & tmpmfgyear))) & "/" & tmpmfgyear
  200.  
  201.  
  202. tmpEDIDMajorVer=Asc(mid(oRawEDID(i),&H12+1,1))
  203.  
  204. tmpEDIDRev=Asc(mid(oRawEDID(i),&H13+1,1))
  205.  
  206.  
  207. If tmpEDIDMajorVer < 255-48 and tmpEDIDRev < 255-48 Then
  208.  
  209. tmpver=Chr(48+tmpEDIDMajorVer) & "." & Chr(48+tmpEDIDRev)
  210.  
  211. Else
  212. tmpver="Not available"
  213.  
  214. End If
  215.  
  216.  
  217. tmpEDIDMfg=mid(oRawEDID(i),&H08+1,2)
  218.  
  219. Char1=0 : Char2=0 : Char3=0
  220.  
  221. Byte1=Asc(Left(tmpEDIDMfg,1)) 'get the first half of the string
  222. Byte2=Asc(Right(tmpEDIDMfg,1)) 'get the first half of the string
  223.  
  224.  
  225. If (Byte1 and 64) > 0 then Char1=Char1+16
  226.  
  227. If (Byte1 and 32) > 0 then Char1=Char1+8
  228.  
  229. If (Byte1 and 16) > 0 then Char1=Char1+4
  230. If (Byte1 and 8) > 0 then Char1=Char1+2
  231. If (Byte1 and 4) > 0 then Char1=Char1+1
  232.  
  233.  
  234. If (Byte1 and 2) > 0 then Char2=Char2+16
  235. If (Byte1 and 1) > 0 then Char2=Char2+8
  236.  
  237.  
  238. If (Byte2 and 128) > 0 then Char2=Char2+4
  239. If (Byte2 and 64) > 0 then Char2=Char2+2
  240. If (Byte2 and 32) > 0 then Char2=Char2+1
  241.  
  242.  
  243. Char3=Char3+(Byte2 and 16)
  244. Char3=Char3+(Byte2 and 8)
  245. Char3=Char3+(Byte2 and 4)
  246. Char3=Char3+(Byte2 and 2)
  247. Char3=Char3+(Byte2 and 1)
  248.  
  249. tmpmfg=Chr(Char1+64) & Chr(Char2+64) & Chr(Char3+64)
  250.  
  251. tmpEDIDDev1=hex(Asc(mid(oRawEDID(i),&H0a+1,1)))
  252. tmpEDIDDev2=hex(Asc(mid(oRawEDID(i),&H0b+1,1)))
  253.  
  254. If Len(tmpEDIDDev1)=1 then tmpEDIDDev1="0" & tmpEDIDDev1
  255. If Len(tmpEDIDDev2)=1 then tmpEDIDDev2="0" & tmpEDIDDev2
  256.  
  257. tmpdev=tmpEDIDDev2 & tmpEDIDDev1
  258.  
  259.  
  260. arrMonitorInfo(i,0)=tmpmfg
  261. arrMonitorInfo(i,1)=tmpdev
  262. arrMonitorInfo(i,2)=tmpmdt
  263. arrMonitorInfo(i,3)=tmpser
  264. arrMonitorInfo(i,4)=tmpmdl
  265. arrMonitorInfo(i,5)=tmpver
  266. End If
  267.  
  268. wscript.echo "Monitor " & Chr(i+65) & ")" & VbCrLF & _
  269. "VESA Manufacturer ID= " & arrMonitorInfo(i,0) & VbCrLF & _
  270.  "Manufacture Date= " & arrMonitorInfo(i,2) & VbCrLF & _
  271.  "Serial Number= " & arrMonitorInfo(i,3) & VbCrLF & _
  272.  "Model Name= " & arrMonitorInfo(i,4)
  273.  
  274. Next
  275.  
  276.  
  277.  
  278. Function ErrorCheck(strErrorNumber)
  279.     Select Case strErrorNumber
  280.         Case "-2147024843"
  281.             ErrorCheck =  strError_ComputerNotFound
  282.         Case "-2147023518"
  283.             ErrorCheck = strError_AlreadyAdmin
  284.         Case "-2147023509"
  285.             ErrorCheck = strError_UserNotFound
  286.     End Select
  287. End Function
  288.  
  289. Function Pingable(strComputer)
  290. Dim objShell
  291. Dim strTemp
  292. Dim objFSO
  293. Dim iReturn
  294. Dim objTextFile
  295. Pingable = False
  296. Set objShell = CreateObject("WScript.Shell")
  297. strTemp = objShell.ExpandEnvironmentStrings("%temp%") & _
  298.  "/tempping.txt"
  299. iReturn = objShell.Run("%comspec% /C ping " & strComputer & _
  300.          " -n 1 > " & strTemp, 0, True)
  301. Set objFSO = CreateObject("Scripting.FileSystemObject")
  302. Set objTextFile = objFSO.OpenTextFile(strTemp, 1)
  303. While Not objTextFile.AtEndOfStream
  304.     If InStr(objTextFile.ReadLine, "Reply") Then Pingable = True
  305. Wend
  306. objTextFile.Close
  307. objFSO.DeleteFile (strTemp)
  308. End Function
  309.  
Nov 14 '06 #1
1 1832
delwar66
14 New Member
Hi Guys
Finally I have figured it out so, pls don't bother.

Thanks
Nov 14 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
2094
by: Toby A Inkster | last post by:
www.authoring.stylesheets] For ages I have provided links to alternate stylesheets from my pages as per W3C recommendations: <link rel="stylesheet" href="baz" type="text/css" title="Baz" media="screen,projection" /> <link rel="alternate stylesheet" href="foo" type="text/css" title="Foo" media="screen,projection" /> <link rel="alternate stylesheet" href="bar" type="text/css" title="Bar"
5
2407
by: User | last post by:
If I want to provide alternate stylesheets (eg red.css, green.css), is it better to put all the stuff that is common to both sheets in a separate css file (eg basic.css) and use @import at the top of each alternative? Does basic.css get downloaded each time the style is changed, or just once (with the first view)? Does it matter? - Is there another way? - -- tenxng@ban.arg.nh Email addy ROT13'd
1
1350
by: Carl Draus | last post by:
I was reading the FixPackReadme.txt file in preparation for installing v8.1 Alternate FP7. The prerequisites section says that all DB2 processes must be stopped and doesn't differentiate between regular an alternate fixpacks. I was hoping the alternate fixpack would help to avoid downtime. Do you really need to stop all DB2 process for alternate fixpack installations? -- Carl Draus
0
1504
by: Jean-Marc Blaise | last post by:
Hi, From version 8.1.2 one can install alternate fixpacks on Unix/Linux. What is the IBM policy on alternate fixpack; is it for temporary testing or can it be permanent in Production ? If I open a PMR about an alternate fixpack problem, do I have the same service than on the GA+Fixpack code ? Can I get a special build, in case ... ?
4
2058
by: Mark A | last post by:
Trying to upgrade alternate FP9 to alternate FP9a on Red Hat Linux. After running the following command: ../installAltFixPak -y it says it was successful, but no new directory is created in /opt/IBM/db2 Assuming that maybe fixpack 9a updates the existing /opt/IBM/db2/V8.FP9 directory, I ran db2iupdt on the instance (using root), but db2level still shows the signature for fixpack 9 (not 9a). "DB2 v8.1.0.88", "s050422"
1
4343
by: Eric Lindsay | last post by:
I am trying to understand the differences between and uses of persistent, default and alternate styles. I have read http://www.w3.org/TR/REC-html40/present/styles.html section 14.3.2 on specifying external style sheets in link using combinations of rel and using or not using the title attribute. I think I sort of understand rel="alternate stylesheet". It seems to be able to act something like the media="print" or media="handheld" or...
5
27552
by: Michael R | last post by:
Searching the net I've found a simple technique to add row numbers and alternate colors (for the even and the uneven row) to a continuous form. 1st step: Create a textbox, send it to background and select the first color. .ControlSouce =fRowNum(False) .Name = RowNum 2nd step: Add the following function to the form module: (for row numbers) Public Function fRowNum(Reset As Boolean) As Long Static I As Integer
9
2494
by: johkar | last post by:
I need some browser implementation clarification. In the below example, the alternate stylesheet could be invoked by user agents that support alternate stylesheets or by script. Are there any browsers that don't recognize "alternate stylesheet" as a value of the rel attribute and just implement it automatically thus overriding sheet2.css? Just need to know what I need to worry about. <link href="sheet1.css" rel="stylesheet"...
0
2525
by: zgh1970 | last post by:
Hi, All, I have some question on the alternate server for the DB connection on db2 connect server. There is one db2 connection to one host database on the server with the following cfg: Database 13 entry: Database alias = DBG0 Database name = DBG0
0
8120
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8620
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8571
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8265
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8423
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7047
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4115
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2560
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1420
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.