Shazam

Forum Replies Created

Viewing 30 posts - 1 through 30 (of 119 total)
  • Author
    Posts
  • Avatar
    Shazam
    Member
    in reply to: updating ADMX #318968
    mla;n506573 wrote:
    Hi,

    THE QUESTION:
    1. is there any chance that after UPDATING (in instructions below it says “update”) previous inetres.admx I will loose some old settings in ADMX template?
    Is update mean “merging” previous and a new one or it is just replacement?

    That is my question as well…by updating the ADMX files in the central store will it overwrite the existing ADMX files? Will I loose all my previous GPO settings?

    Avatar
    Shazam
    Member
    in reply to: Need Help to Modify Pinning Shortcut VBScript #318967
    wullieb1;n506233 wrote:
    Have you tried running it on a Windows 10 PC??

    What happens??

    Yes. I ran it and nothing happens. I’ve been researching online and it seems other scripts like powershell is also having this problem.

    Avatar
    Shazam
    Member
    in reply to: Need Help to Modify Pinning Shortcut VBScript #318966

    Hi,
    Can the code be modified to work with Windows 10?

    Any help?

    Avatar
    Shazam
    Member
    in reply to: VBS nslookup list #318965

    How can I get a list of computers of what logon server are they logging onto?

    Avatar
    Shazam
    Member
    in reply to: VBS nslookup list #318964
    joeqwerty;n495293 wrote:
    How would this show you what DC the computers are authenticating to? This would show you what DNS server the computers are using for DNS.

    I’m sorry your right.

    I’m looking for this

    echo %LOGONSERVER%

    to be used in a VBscript.

    Avatar
    Shazam
    Member
    in reply to: Need Help to Modify Pinning Shortcut VBScript #318963

    Re: Need Help to Modify Pinning Shortcut VBScript

    Rems;290107 wrote:
    Wildcards in the string is not supported. With the * the file path has become unvalid.

    The AppPath variable is actually defined for a second time by the second orange line is where it retrieves the program path of AcroRd32.exe from registry.

    Basically the the first orange line is in most cases fully redundant.

    /Rems

    Thanks!

    Once again thank you so much for your help.

    Avatar
    Shazam
    Member
    in reply to: Need Help to Modify Pinning Shortcut VBScript #318962

    Re: Need Help to Modify Pinning Shortcut VBScript

    Thank you Rems. It works great.

    One other thing some users have Adobe Reader 10.0 or 11.0. Look at the program path below.

    Adobe Reader:
    C:Program Files (x86)AdobeReader 10.0ReaderAcroRd32.exe

    Or

    C:Program Files (x86)AdobeReader 11.0ReaderAcroRd32.exe

    So I change one thing in your code to act as a wildcard. using “*” .I ran the VBSafter adding the asterisk and it ran just fine, but is that the proper way of doing it?

    [COLOR=DarkOrange]AppPath = “C:Program Files (x86)AdobeReader*ReaderAcroRd32.exe”[/COLOR][/CODE][CODE]AppPath = “C:Program Files (x86)AdobeReader*ReaderAcroRd32.exe”[/CODE]

    Avatar
    Shazam
    Member
    in reply to: VBScript to Refresh Desktop #318961

    Re: VBScript to Refresh Desktop

    Rems;284499 wrote:
    here the new script where I added a 950 seconds delay,

    Code:
    Set WshShell = CreateObject(“WScript.Shell”)
    Set objShell = CreateObject(“Shell.Application”)

    strTartgetFile = “[COLOR=blue]\filesDATAHRPhone ListPhoneListPHONELST.pdf[/COLOR]”

    ShortcutName = “[COLOR=blue]PHONELST[/COLOR]”
    ShortcutFolder = WshShell.SpecialFolders.Item(“Desktop”)
    ShortcutFile = ShortcutName & “.lnk”

    call PinToTaskbar(“unpin”)

    FilePath = ShortcutFolder & “” & ShortcutFile

    With WshShell.CreateShortcut(FilePath)
    .TargetPath = GetProgramAssocWith(“PDF”)
    .Arguments = “””” & strTartgetFile & “”””
    .WorkingDirectory = “.”
    .IconLocation = “imageres.dll, 124”
    .Description = “…”
    .Save
    End With

    call PinToTaskbar(“pin”) : [B]WScript.Sleep 950[/B]

    Set objFSO = CreateObject(“Scripting.FileSystemObject”)
    objFSO.DeleteFile(FilePath), true

    wscript.quit

    Function GetProgramAssocWith(strExt)
    Const HKCR=&H80000000
    Const HKCU=&H80000001
    Set objReg = GetObject(“winmgmts:\.rootdefault:StdRegProv”)

    strExt = Replace(strExt,”*”,””)
    If Left(strExt,1) “.” Then strExt = “.” & strExt

    strPath = “SoftwareMicrosoftWindowsCurrentVersionExplorerFileExts” & strExt & “UserChoice”
    objReg.GetExpandedStringValue HKCU, strPath, “Progid”, strValue
    If IsNull(strValue) Then
    objReg.GetExpandedStringValue HKCR, strExt, strEntry, strValue
    End If
    If IsNull(strValue) Then wscript.quit

    strPath = strValue & “shellopencommand”
    objReg.GetExpandedStringValue HKCR, strPath, strEntry, strValue
    strValue = Replace(strValue, “”””, “”)

    http://www.akaplan.com/blog/2010/12/vbscript-to-get-program-associated-with-file-extension/
    If InStr(strValue,”rundll”) Then
    Dim tArray
    tArray = split(strValue,”,”)
    GetProgramAssocWith = replace(tArray(0),”rundll32.exe”,””)
    Else
    strValue = LCase(strValue)
    GetProgramAssocWith = Left(strValue,instrrev(strValue,”.exe”)+3)
    End If
    End Function

    Sub PinToTaskbar(choice)

    On Error Resume Next

    If Lcase(choice) = “unpin” then

    LnkFolder = WshShell.SpecialFolders.Item(“AppData”)
    LnkFolder = LnkFolder & “MicrosoftInternet ExplorerQuick LaunchUser PinnedTaskBar”
    LnkFile = ShortcutName & “.lnk”

    Set objFolder = objShell.Namespace(LnkFolder)
    Set objFolderItem = objFolder.ParseName(LnkFile)
    Set colVerbs = objFolderItem.Verbs
    For Each objVerb in colVerbs
    Select Case Replace(objVerb.name, “&”, “”)
    case “Unpin from Taskbar” objVerb.DoIt
    case “other language …” objVerb.DoIt
    case “other language …” objVerb.DoIt
    case “other language …” objVerb.DoIt
    End Select
    Next

    ElseIf Lcase(choice) = “pin” then

    Set objFolder = objShell.Namespace(ShortcutFolder)
    Set objFolderItem = objFolder.ParseName(ShortcutFile)
    Set colVerbs = objFolderItem.Verbs
    For Each objVerb in colVerbs
    Select Case Replace(objVerb.name, “&”, “”)
    case “Pin to Taskbar” objVerb.DoIt
    case “Ajouter au menu Démarrer” objVerb.DoIt
    case “Aggiungi a menu Start” objVerb.DoIt
    case “An Startmenü anheften” objVerb.DoIt
    case “Aan het menu Start vastmaken” objVerb.DoIt
    case “Associar ao Menu Iniciar” objVerb.DoIt
    case “Anclar al menú Inicio” objVerb.DoIt
    End Select
    Next

    End If
    End Sub

    /Rems

    I tested on the trouble computers and it worked!!

    Thank you so much Rems.

    Avatar
    Shazam
    Member
    in reply to: VBScript to Refresh Desktop #318960

    Re: VBScript to Refresh Desktop

    Rems;284499 wrote:
    Did it solved the problem for you? If it is the solution you could make this a computer start up script, running this comand line (for 64-bits OS):
    REG.exe ADD “HKCRWow6432NodeCLSID{BDEADE7F-C265-11D0-BCED-00A0C90AB50F}Instance” /v DontRefresh /t REG_DWORD /d 0 /f[/CODE]Actually what I think the script was missing and would probably resolve the problem too, is a short delay between pinning and deleting the shortcut file on/from the desktop./Rems[/QUOTE]

    The solution I provided did not work on some of the computers I tried. Don’t know why.[CODE]REG.exe ADD “HKCRWow6432NodeCLSID{BDEADE7F-C265-11D0-BCED-00A0C90AB50F}Instance” /v DontRefresh /t REG_DWORD /d 0 /f[/CODE]Actually what I think the script was missing and would probably resolve the problem too, is a short delay between pinning and deleting the shortcut file on/from the desktop./Rems

    The solution I provided did not work on some of the computers I tried. Don’t know why.

    Avatar
    Shazam
    Member
    in reply to: VBScript to Refresh Desktop #318959

    Re: VBScript to Refresh Desktop

    Ok I created a Reg file to resolve my issue.

    I found the answer from the link below.

    http://www.thewindowsclub.com/desktop-does-not-refresh-automatically-windows

    From the description below I copied it into a text file, saved it. Then I changed it extension from .txt to .reg, and ran it.

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOTWow6432NodeCLSID{BDEADE7F-C265-11D0-BCED-00A0C90AB50F}Instance]
    “CLSID”=”{4D5C8C2A-D075-11D0-B416-00C04FB90376}”
    “DontRefresh”=dword:00000000

    Avatar
    Shazam
    Member
    in reply to: VBScript to Refresh Desktop #318958

    Re: VBScript to Refresh Desktop

    It looks like the code works great in Windows 8.1 BUT not Windows 7. It turns out Windows 7 has a known bug for refreshing.

    How about this…

    How about having the code instead of deleting the file, it would move the file to the Recycle Bin?

    Can VBScript is able to do that?

    Avatar
    Shazam
    Member

    Re: Pinning a specific shortcut file (*.lnk) onto the Windows 7 Taskbar?

    Rems;284379 wrote:
    Glad to be of help

    You can leave rep points by clicking the yinyan symbol that is in the post that helped you.
    Not sure if this link can do that also: http://forums.petri.com/reputation.php?p=284244 if not, just go to the post, there you find the symbol in the upper right corner.

    /Rems

    I figured it out.

    Thank you!

    Avatar
    Shazam
    Member

    Re: Pinning a specific shortcut file (*.lnk) onto the Windows 7 Taskbar?

    Rems;284377 wrote:
    Actually it is icon 124 in the executable imageres.dll. Because the first icon is number 0 and not 1.

    I have updated the script.

    /Rems

    Thank you so much for your help rems. The code works great.

    Once again thank you.

    Avatar
    Shazam
    Member

    Re: Pinning a specific shortcut file (*.lnk) onto the Windows 7 Taskbar?

    I found a link that tells me the particular custom icon I would like to use. It’s Icon 125 (10).

    http://diymediahome.org/windows-icons-reference-list-with-details-locations-images/

    Avatar
    Shazam
    Member

    Re: Pinning a specific shortcut file (*.lnk) onto the Windows 7 Taskbar?

    Wow!! Thank you so much.

    One more thing…

    I know this sounds a little to much, but can we have a different icon for the customize pin icon?

    Please look at the attachments.

    A1 jpg – Some users has already an Acrobat icon pinned on the taskbar.

    A2 jpg – Can we have a different icon.

    A3 jpg – This has the location of the icon.

    Avatar
    Shazam
    Member

    Re: Pinning a specific shortcut file (*.lnk) onto the Windows 7 Taskbar?

    How about this…

    Can you upload the code as an attachment?

    I’m thinking (this is a wild guess) that pasting your code to this forum might change unforeseen characters on your code. Wrapping the code on this thread might be causing the issue.

    Avatar
    Shazam
    Member

    Re: Pinning a specific shortcut file (*.lnk) onto the Windows 7 Taskbar?

    Hi,

    I’m not getting the unicode message anymore but I’m still getting the same error when running your code. I copied your code again paste in notepad, ran it and still same error. Here’s the code.

    I ran this code on 3 different computers. I ran it on Windows 8.1 Pro 64-bit, Windows 7 Pro 64-bit and Server 2008 R2 Standard. All came back with the same error.

    Set WshShell = CreateObject(“WScript.Shell”)

    strTartgetFile = “\filesDATAHRPhone ListPhoneListPHONELST.pdf”

    strAPP = GetProgramAssocWith(“PDF”)

    ShortcutName = “PHONELST”
    ShortcutFolder = WshShell.SpecialFolders.Item(“Desktop”)

    ShortcutFile = ShortcutFolder & “” & ShortcutName & “.lnk”

    With WshShell.CreateShortcut(ShortcutFile)
    .TargetPath = strAPP
    .Arguments = “””” & strTartgetFile & “”””
    .WorkingDirectory = “.”
    .Save
    End With

    PinToTaskbar

    wscript.quit

    Function GetProgramAssocWith(strExt)
    Const HKCR=&H80000000
    Set objReg = GetObject(“winmgmts:\.rootdefault:StdRegProv”)

    strExt = Replace(strExt,”*”,””)
    If Left(strExt,1) “.” Then strExt = “.” & strExt

    objReg.GetExpandedStringValue HKCR, strExt, strEntry, strType
    strPath = strType & “shellopencommand”
    objReg.GetExpandedStringValue HKCR, strPath, strEntry, strValue

    ‘http://www.akaplan.com/blog/2010/12/vbscript-to-get-program-associated-with-file-extension/
    If InStr(strValue,”rundll”) Then
    Dim tArray
    tArray = split(strValue,”,”)
    GetProgramAssocWith = replace(tArray(0),”rundll32.exe”,””)
    Else
    strValue = LCase(strValue)
    GetProgramAssocWith = Left(strValue,instrrev(strValue,”.exe”)+3)
    End If
    End Function

    Sub PinToTaskbar
    ‘http://blogs.technet.com/b/deploymentguys/archive/2009/04/08/pin-items-to-the-start-menu-or-windows-7-taskbar-via-script.aspx
    Set objShell = CreateObject(“Shell.Application”)
    Set objFolder = objShell.Namespace(ShortcutFolder)
    Set objFolderItem = objFolder.ParseName(ShortcutFile)
    Set colVerbs = objFolderItem.Verbs
    For Each objVerb in colVerbs
    Select Case Replace(objVerb.name, “&”, “”)
    case “Unpin from Taskbar” objVerb.DoIt
    ‘you can add other languages ??that apply to your environment….
    End Select
    Next
    Set colVerbs = objFolderItem.Verbs
    For Each objVerb in colVerbs
    Select Case Replace(objVerb.name, “&”, “”)
    case “Pin to Taskbar” objVerb.DoIt
    case “Ajouter au menu Démarrer” objVerb.DoIt
    case “Aggiungi a menu Start” objVerb.DoIt
    case “An Startmenü anheften” objVerb.DoIt
    case “Aan het menu Start vastmaken” objVerb.DoIt
    case “Associar ao Menu Iniciar” objVerb.DoIt
    case “Anclar al menú Inicio” objVerb.DoIt
    End Select
    Next
    End Sub[/CODE][CODE]Set WshShell = CreateObject(“WScript.Shell”)

    strTartgetFile = “\filesDATAHRPhone ListPhoneListPHONELST.pdf”

    strAPP = GetProgramAssocWith(“PDF”)

    ShortcutName = “PHONELST”
    ShortcutFolder = WshShell.SpecialFolders.Item(“Desktop”)

    ShortcutFile = ShortcutFolder & “” & ShortcutName & “.lnk”

    With WshShell.CreateShortcut(ShortcutFile)
    .TargetPath = strAPP
    .Arguments = “””” & strTartgetFile & “”””
    .WorkingDirectory = “.”
    .Save
    End With

    PinToTaskbar

    wscript.quit

    Function GetProgramAssocWith(strExt)
    Const HKCR=&H80000000
    Set objReg = GetObject(“winmgmts:\.rootdefault:StdRegProv”)

    strExt = Replace(strExt,”*”,””)
    If Left(strExt,1) “.” Then strExt = “.” & strExt

    objReg.GetExpandedStringValue HKCR, strExt, strEntry, strType
    strPath = strType & “shellopencommand”
    objReg.GetExpandedStringValue HKCR, strPath, strEntry, strValue

    ‘http://www.akaplan.com/blog/2010/12/vbscript-to-get-program-associated-with-file-extension/
    If InStr(strValue,”rundll”) Then
    Dim tArray
    tArray = split(strValue,”,”)
    GetProgramAssocWith = replace(tArray(0),”rundll32.exe”,””)
    Else
    strValue = LCase(strValue)
    GetProgramAssocWith = Left(strValue,instrrev(strValue,”.exe”)+3)
    End If
    End Function

    Sub PinToTaskbar
    ‘http://blogs.technet.com/b/deploymentguys/archive/2009/04/08/pin-items-to-the-start-menu-or-windows-7-taskbar-via-script.aspx
    Set objShell = CreateObject(“Shell.Application”)
    Set objFolder = objShell.Namespace(ShortcutFolder)
    Set objFolderItem = objFolder.ParseName(ShortcutFile)
    Set colVerbs = objFolderItem.Verbs
    For Each objVerb in colVerbs
    Select Case Replace(objVerb.name, “&”, “”)
    case “Unpin from Taskbar” objVerb.DoIt
    ‘you can add other languages ??that apply to your environment….
    End Select
    Next
    Set colVerbs = objFolderItem.Verbs
    For Each objVerb in colVerbs
    Select Case Replace(objVerb.name, “&”, “”)
    case “Pin to Taskbar” objVerb.DoIt
    case “Ajouter au menu Démarrer” objVerb.DoIt
    case “Aggiungi a menu Start” objVerb.DoIt
    case “An Startmenü anheften” objVerb.DoIt
    case “Aan het menu Start vastmaken” objVerb.DoIt
    case “Associar ao Menu Iniciar” objVerb.DoIt
    case “Anclar al menú Inicio” objVerb.DoIt
    End Select
    Next
    End Sub[/CODE]

    Avatar
    Shazam
    Member

    Re: Pinning a specific shortcut file (*.lnk) onto the Windows 7 Taskbar?

    It might be the way I’m saving your code in a vbs file. I took a screen shot of the message. Please look at the attachment.

    It’s forcing me to save it in Unicode. Do you think that might be changing the syntax?

    Is this what you meant copy the lines from my file 11 to 15?

    Quote:
    ShortcutFile = ShortcutFolder & “” & ShortcutName & “.lnk”

    With WshShell.CreateShortcut(ShortcutFile)
    .TargetPath = strAPP
    .Arguments = “””” & strTartgetFile & “”””
    .WorkingDirectory = “.”
    .Save
    End With

    Avatar
    Shazam
    Member

    Re: Pinning a specific shortcut file (*.lnk) onto the Windows 7 Taskbar?

    Hi rems,

    Thank you for the code. I ran your code and I’m getting an error message. Please look at the attachment.

    Avatar
    Shazam
    Member

    Re: Pinning a specific shortcut file (*.lnk) onto the Windows 7 Taskbar?

    Rems;284244 wrote:
    You can make use of the present file extension association on the computer. Then you don’t have to ‘pin’ the adobe executable, you can use cmd.exe.
    C:WindowsSystem32cmd.exe /c “start “”/b “\filesDATAHRPhone ListPhoneListPHONELST.pdf””[/CODE]

    Why do you prefere to use Adobe Acrobat to open a PHONELST.pdf ? You still could install or upgrade Adobe Reader or Nitro Reader on the clients next to Adobe Acrobat.

    /Rems[/QUOTE]

    Thank you so much for replying Rems.

    The reason we use Acrobat because is to sign documents, like, time-sheets, contracts, memos, etc. Every user here at the company has a digital signature created for them. And with those digital signatures some users are restricted to open certain documents (PFX, Certificates). This has been a standard here for awhile. And management wants to keep everything standard.

    The easy way out of this is to create a login script that the PHONELIST.pdf will always appear on the user’s desktop. BUT there’s a somewhat preference with that. When users have multiple windows open on their desktop and if they wanted to look at the phone list pdf file they will have to click on “Show Desktop” and that will minimize all their windows so they can click on the PHONELIST.pdf shortcut. I know it sounds lazy or just plain ridiculous but people are people.

    Please look at the attachment. If somehow we can programmatically get the custom shortcut to pin on the task bar that’ll be great.
    As you can see on the jpeg photo, by having that shortcut pinned to the taskbar…the users don’t have to minimize all their windows.
    The hardest part of the code is probably figuring out what version of Acrobat are the users using on their computers. Maybe the VBS file can do a resume error. So if this fails…

    C:Program Files (x86)AdobeAcrobat 8.0 AcrobatAcrobat.exe

    Then go to find this path
    C:Program Files (x86)AdobeAcrobat 9.0 AcrobatAcrobat.exe

    If fails again find this path
    C:Program Files (x86)AdobeAcrobat 10.0 AcrobatAcrobat.exe

    Or this one
    C:Program Files (x86)AdobeReader 9.0Reader AcroRd32.exe

    And this one
    C:Program Files (x86)AdobeReader 11.0Reader AcroRd32.exe

    Please let me know if this is possible.[CODE]C:WindowsSystem32cmd.exe /c “start “”/b “\filesDATAHRPhone ListPhoneListPHONELST.pdf””[/CODE]

    Why do you prefere to use Adobe Acrobat to open a PHONELST.pdf ? You still could install or upgrade Adobe Reader or Nitro Reader on the clients next to Adobe Acrobat.

    /Rems

    Thank you so much for replying Rems.

    The reason we use Acrobat because is to sign documents, like, time-sheets, contracts, memos, etc. Every user here at the company has a digital signature created for them. And with those digital signatures some users are restricted to open certain documents (PFX, Certificates). This has been a standard here for awhile. And management wants to keep everything standard.

    The easy way out of this is to create a login script that the PHONELIST.pdf will always appear on the user’s desktop. BUT there’s a somewhat preference with that. When users have multiple windows open on their desktop and if they wanted to look at the phone list pdf file they will have to click on “Show Desktop” and that will minimize all their windows so they can click on the PHONELIST.pdf shortcut. I know it sounds lazy or just plain ridiculous but people are people.

    Please look at the attachment. If somehow we can programmatically get the custom shortcut to pin on the task bar that’ll be great.
    As you can see on the jpeg photo, by having that shortcut pinned to the taskbar…the users don’t have to minimize all their windows.
    The hardest part of the code is probably figuring out what version of Acrobat are the users using on their computers. Maybe the VBS file can do a resume error. So if this fails…

    C:Program Files (x86)AdobeAcrobat 8.0 AcrobatAcrobat.exe

    Then go to find this path
    C:Program Files (x86)AdobeAcrobat 9.0 AcrobatAcrobat.exe

    If fails again find this path
    C:Program Files (x86)AdobeAcrobat 10.0 AcrobatAcrobat.exe

    Or this one
    C:Program Files (x86)AdobeReader 9.0Reader AcroRd32.exe

    And this one
    C:Program Files (x86)AdobeReader 11.0Reader AcroRd32.exe

    Please let me know if this is possible.

    Avatar
    Shazam
    Member

    Re: Pinning a specific shortcut file (*.lnk) onto the Windows 7 Taskbar?

    Bertmax;284144 wrote:
    What he’s saying is, if your network is on a domain (as opposed to a workgroup), you can use group policy to install Acrobat Reader 11 on all connected computers. Get everyone on the same version and there’s no need for wild cards.

    Thanks for replying.

    That’s not possible. We have a mix environment on our Domain network. We have Adobe 8-11 standards. And some Adobe readers. If we were just using Adobe Reader then it will work but we are not.

    Avatar
    Shazam
    Member

    Re: Pinning a specific shortcut file (*.lnk) onto the Windows 7 Taskbar?

    biggles77;283995 wrote:
    If you are on a Domain, push out version 11. v8 is out of date and I think no longer supported. v9 has the last supported update released on a machine I updated yesterday. 9.5.4 if memory serves me correct.

    Hi,

    I’m not understanding what you are saying.

    Avatar
    Shazam
    Member

    Re: Help Modifying Script To Retrieve Last Windows Update Date and Time From Computer

    Ok I was able to get it resolved. It was actually quite simple.

    I added more spaces between the &” “&.

    objTextFile.WriteLine(strComputer & ” ” & strValue)[/CODE]

    Thanks everyone for all your help. I really do appreciate it.

    And a special thanks to you Rems. You have helped me in the past before.

    Here is the code I ended up using.

    [CODE]Const HKEY_LOCAL_COMPUTER = &H80000002
    Const ForAppending = 8

    On Error Resume Next

    strKeyPath = “SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdate” _
    & “Auto UpdateResultsInstall”
    strEntryName = “LastSuccessTime”

    Set objGetComputerList = CreateObject(“Scripting.FileSystemObject”)

    Set fsoReadComputerList = objGetComputerList.OpenTextFile(“C:FolderLocationcomputers.txt”, 1)
    aryServers = Split(fsoReadComputerList.ReadAll, vbCrLf)
    fsoReadComputerList.Close

    Set objTextFile = objGetComputerList.OpenTextFile(“C:FolderLocationupdate.txt”, _
    ForAppending, True)

    For Each strComputer In aryServers

    Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & _
    strComputer & “rootdefault:StdRegProv”)
    objReg.GetStringValue HKEY_LOCAL_COMPUTER, strKeyPath, _
    strEntryName, strValue
    objTextFile.WriteLine(strComputer & ” ” & strValue)

    Next
    objTextFile.Close

    wscript.quit[/CODE][CODE]objTextFile.WriteLine(strComputer & ” ” & strValue)[/CODE]

    Thanks everyone for all your help. I really do appreciate it.

    And a special thanks to you Rems. You have helped me in the past before.

    Here is the code I ended up using.

    Const HKEY_LOCAL_COMPUTER = &H80000002
    Const ForAppending = 8

    On Error Resume Next

    strKeyPath = “SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdate” _
    & “Auto UpdateResultsInstall”
    strEntryName = “LastSuccessTime”

    Set objGetComputerList = CreateObject(“Scripting.FileSystemObject”)

    Set fsoReadComputerList = objGetComputerList.OpenTextFile(“C:FolderLocationcomputers.txt”, 1)
    aryServers = Split(fsoReadComputerList.ReadAll, vbCrLf)
    fsoReadComputerList.Close

    Set objTextFile = objGetComputerList.OpenTextFile(“C:FolderLocationupdate.txt”, _
    ForAppending, True)

    For Each strComputer In aryServers

    Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & _
    strComputer & “rootdefault:StdRegProv”)
    objReg.GetStringValue HKEY_LOCAL_COMPUTER, strKeyPath, _
    strEntryName, strValue
    objTextFile.WriteLine(strComputer & ” ” & strValue)

    Next
    objTextFile.Close

    wscript.quit[/CODE][CODE]Const HKEY_LOCAL_COMPUTER = &H80000002
    Const ForAppending = 8

    On Error Resume Next

    strKeyPath = “SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdate” _
    & “Auto UpdateResultsInstall”
    strEntryName = “LastSuccessTime”

    Set objGetComputerList = CreateObject(“Scripting.FileSystemObject”)

    Set fsoReadComputerList = objGetComputerList.OpenTextFile(“C:FolderLocationcomputers.txt”, 1)
    aryServers = Split(fsoReadComputerList.ReadAll, vbCrLf)
    fsoReadComputerList.Close

    Set objTextFile = objGetComputerList.OpenTextFile(“C:FolderLocationupdate.txt”, _
    ForAppending, True)

    For Each strComputer In aryServers

    Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & _
    strComputer & “rootdefault:StdRegProv”)
    objReg.GetStringValue HKEY_LOCAL_COMPUTER, strKeyPath, _
    strEntryName, strValue
    objTextFile.WriteLine(strComputer & ” ” & strValue)

    Next
    objTextFile.Close

    wscript.quit[/CODE]

    Avatar
    Shazam
    Member

    Re: Help Modifying Script To Retrieve Last Windows Update Date and Time From Computer

    Ok. I got it to capture all the computers. Leaving the…

    On Error Resume Next[/CODE]

    in the code.

    One more thing…

    Can the code be modified to space out the computer names and the date and time? Because when I try to import it in an excel file it’s all in one column. If it was more space out, then I can use the delimiter in excel to import it in properly.

    Is this possible?[CODE]On Error Resume Next[/CODE]

    in the code.

    One more thing…

    Can the code be modified to space out the computer names and the date and time? Because when I try to import it in an excel file it’s all in one column. If it was more space out, then I can use the delimiter in excel to import it in properly.

    Is this possible?

    Avatar
    Shazam
    Member

    Re: Help Modifying Script To Retrieve Last Windows Update Date and Time From Computer

    Rems;274260 wrote:
    For testing purpose remove the line: On Error Resume Next

    And the two Const variables below should be defined before the For-Next loop, and not within the loop.
    Const HKEY_LOCAL_COMPUTER = &H80000002[/CODE]
    [CODE]Const ForAppending = 8[/CODE]

    _
    [CODE]’ Script pulls last Windows update info from registry of
    ‘ all computers specified in computers text file and echos on screen

    Const HKEY_LOCAL_COMPUTER = &H80000002
    Const ForAppending = 8

    rem On Error Resume Next

    strKeyPath = “SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdate” _
    & “Auto UpdateResultsInstall”
    strEntryName = “LastSuccessTime”

    Set objGetComputerList = CreateObject(“Scripting.FileSystemObject”)

    Set fsoReadComputerList = objGetComputerList.OpenTextFile(“computers.txt”, 1)
    aryServers = Split(fsoReadComputerList.ReadAll, vbCrLf)
    fsoReadComputerList.Close

    Set objTextFile = objGetComputerList.OpenTextFile(“c:update.txt”, _
    ForAppending, True)

    For Each strComputer In aryServers

    Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & _
    strComputer & “rootdefault:StdRegProv”)
    objReg.GetStringValue HKEY_LOCAL_COMPUTER, strKeyPath, _
    strEntryName, strValue
    objTextFile.WriteLine(strComputer & ” ” & strValue)

    Next
    objTextFile.Close

    wscript.quit[/CODE][/QUOTE]

    Thank you so much for working on this.

    The results did not complete though. It seems to stop if it reaches a computer that is shutdown.

    My computer list shows way over 100 computers and only less than 5 showed up on the results file. I think the script stops if it can’t reach a particular computer.

    Can the script be modify to move on to the next computer if a computer is not reachable?[CODE]Const HKEY_LOCAL_COMPUTER = &H80000002[/CODE]
    Const ForAppending = 8[/CODE]

    _
    [CODE]’ Script pulls last Windows update info from registry of
    ‘ all computers specified in computers text file and echos on screen

    Const HKEY_LOCAL_COMPUTER = &H80000002
    Const ForAppending = 8

    rem On Error Resume Next

    strKeyPath = “SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdate” _
    & “Auto UpdateResultsInstall”
    strEntryName = “LastSuccessTime”

    Set objGetComputerList = CreateObject(“Scripting.FileSystemObject”)

    Set fsoReadComputerList = objGetComputerList.OpenTextFile(“computers.txt”, 1)
    aryServers = Split(fsoReadComputerList.ReadAll, vbCrLf)
    fsoReadComputerList.Close

    Set objTextFile = objGetComputerList.OpenTextFile(“c:update.txt”, _
    ForAppending, True)

    For Each strComputer In aryServers

    Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & _
    strComputer & “rootdefault:StdRegProv”)
    objReg.GetStringValue HKEY_LOCAL_COMPUTER, strKeyPath, _
    strEntryName, strValue
    objTextFile.WriteLine(strComputer & ” ” & strValue)

    Next
    objTextFile.Close

    wscript.quit[/CODE][/QUOTE]

    Thank you so much for working on this.

    The results did not complete though. It seems to stop if it reaches a computer that is shutdown.

    My computer list shows way over 100 computers and only less than 5 showed up on the results file. I think the script stops if it can’t reach a particular computer.

    Can the script be modify to move on to the next computer if a computer is not reachable?[CODE]Const ForAppending = 8[/CODE]

    _
    ‘ Script pulls last Windows update info from registry of
    ‘ all computers specified in computers text file and echos on screen

    Const HKEY_LOCAL_COMPUTER = &H80000002
    Const ForAppending = 8

    rem On Error Resume Next

    strKeyPath = “SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdate” _
    & “Auto UpdateResultsInstall”
    strEntryName = “LastSuccessTime”

    Set objGetComputerList = CreateObject(“Scripting.FileSystemObject”)

    Set fsoReadComputerList = objGetComputerList.OpenTextFile(“computers.txt”, 1)
    aryServers = Split(fsoReadComputerList.ReadAll, vbCrLf)
    fsoReadComputerList.Close

    Set objTextFile = objGetComputerList.OpenTextFile(“c:update.txt”, _
    ForAppending, True)

    For Each strComputer In aryServers

    Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & _
    strComputer & “rootdefault:StdRegProv”)
    objReg.GetStringValue HKEY_LOCAL_COMPUTER, strKeyPath, _
    strEntryName, strValue
    objTextFile.WriteLine(strComputer & ” ” & strValue)

    Next
    objTextFile.Close

    wscript.quit[/CODE][/QUOTE]

    Thank you so much for working on this.

    The results did not complete though. It seems to stop if it reaches a computer that is shutdown.

    My computer list shows way over 100 computers and only less than 5 showed up on the results file. I think the script stops if it can’t reach a particular computer.

    Can the script be modify to move on to the next computer if a computer is not reachable?[CODE]’ Script pulls last Windows update info from registry of
    ‘ all computers specified in computers text file and echos on screen

    Const HKEY_LOCAL_COMPUTER = &H80000002
    Const ForAppending = 8

    rem On Error Resume Next

    strKeyPath = “SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdate” _
    & “Auto UpdateResultsInstall”
    strEntryName = “LastSuccessTime”

    Set objGetComputerList = CreateObject(“Scripting.FileSystemObject”)

    Set fsoReadComputerList = objGetComputerList.OpenTextFile(“computers.txt”, 1)
    aryServers = Split(fsoReadComputerList.ReadAll, vbCrLf)
    fsoReadComputerList.Close

    Set objTextFile = objGetComputerList.OpenTextFile(“c:update.txt”, _
    ForAppending, True)

    For Each strComputer In aryServers

    Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & _
    strComputer & “rootdefault:StdRegProv”)
    objReg.GetStringValue HKEY_LOCAL_COMPUTER, strKeyPath, _
    strEntryName, strValue
    objTextFile.WriteLine(strComputer & ” ” & strValue)

    Next
    objTextFile.Close

    wscript.quit[/CODE]

    Thank you so much for working on this.

    The results did not complete though. It seems to stop if it reaches a computer that is shutdown.

    My computer list shows way over 100 computers and only less than 5 showed up on the results file. I think the script stops if it can’t reach a particular computer.

    Can the script be modify to move on to the next computer if a computer is not reachable?

    Avatar
    Shazam
    Member

    Re: Help Modifying Script To Retrieve Last Windows Update Date and Time From Computer

    Thank you so much for replying wullieb1.

    I added your code to my existing script. Nothing happens after I run it.

    Please look at the script below. Am I doing something wrong?

    ‘Script pulls last Windows update info from registry of all computers specified in computers text file and echos on screen

    On Error Resume Next

    Set objGetComputerList = CreateObject(“Scripting.FileSystemObject”)
    Set fsoReadComputerList = objGetComputerList.OpenTextFile(“update.txt”, 1, TristateFalse)
    aryServers = Split(fsoReadComputerList.ReadAll, vbCrLf)
    fsoReadComputerList.Close

    For Each strComputer In aryServers

    Const HKEY_LOCAL_COMPUTER = &H80000002

    strKeyPath = “SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdateResultsInstall”
    strEntryName = “LastSuccessTime”
    Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & _
    strComputer & “rootdefault:StdRegProv”)
    objReg.GetStringValue HKEY_LOCAL_COMPUTER, strKeyPath, strEntryName, strValue

    Const ForAppending = 8

    If objGetComputerList.FileExists(“c:update.txt”) Then
    Set objTextFile = objGetComputerList.OpenTextFile(“c:update.txt”, ForAppending, True)
    objTextFile.WriteLine(strComputer & ” ” & strValue)
    objTextFile.Close
    Else
    objGetComputerList.CreateTextFile(“c:update.txt”)
    Set objTextFile = objGetComputerList.OpenTextFile(“c:update.txt”, ForAppending, True)
    objTextFile.WriteLine(strComputer & ” ” & strValue)
    objTextFile.Close
    End If

    Next[/CODE][CODE]’Script pulls last Windows update info from registry of all computers specified in computers text file and echos on screen

    On Error Resume Next

    Set objGetComputerList = CreateObject(“Scripting.FileSystemObject”)
    Set fsoReadComputerList = objGetComputerList.OpenTextFile(“update.txt”, 1, TristateFalse)
    aryServers = Split(fsoReadComputerList.ReadAll, vbCrLf)
    fsoReadComputerList.Close

    For Each strComputer In aryServers

    Const HKEY_LOCAL_COMPUTER = &H80000002

    strKeyPath = “SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdateResultsInstall”
    strEntryName = “LastSuccessTime”
    Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\” & _
    strComputer & “rootdefault:StdRegProv”)
    objReg.GetStringValue HKEY_LOCAL_COMPUTER, strKeyPath, strEntryName, strValue

    Const ForAppending = 8

    If objGetComputerList.FileExists(“c:update.txt”) Then
    Set objTextFile = objGetComputerList.OpenTextFile(“c:update.txt”, ForAppending, True)
    objTextFile.WriteLine(strComputer & ” ” & strValue)
    objTextFile.Close
    Else
    objGetComputerList.CreateTextFile(“c:update.txt”)
    Set objTextFile = objGetComputerList.OpenTextFile(“c:update.txt”, ForAppending, True)
    objTextFile.WriteLine(strComputer & ” ” & strValue)
    objTextFile.Close
    End If

    Next[/CODE]

    Avatar
    Shazam
    Member
    in reply to: I keep loosing my Ethernet Card Driver #318942

    Re: I keep loosing my Ethernet Card Driver

    Rems;250594 wrote:
    Try disabling “Smart Power Down” (or DSPD) on the NIC.

    /Rems

    So I got it resolved (Kind of) by powering down the laptop and then unplug it and pulled the battery. But if I put it in sleep mode again the same problem occurs.

    I’ll try your suggestion Rems and let your know.

    Avatar
    Shazam
    Member
    in reply to: Copy the Most Recent File created. #318941

    Re: Copy the Most Recent File created.

    Thank you so much Rems!

    Avatar
    Shazam
    Member
    in reply to: I keep loosing my Ethernet Card Driver #318940

    Re: I keep loosing my Ethernet Card Driver

    biggles77;249647 wrote:
    Have you scanned the HDD for Spyware, Malware, Virus and Rootkit?

    What happens if you reboot and not do a System Restore?

    I have scanned, I use “Microsoft security Essentials”.

    Re-booting does not help.

    I woke up this morning and my ethernet driver is still installed. This what I’ve done so far. I notice there were allot of active scheduled runs in my scheduled task manager, so I deleted every thing. Also, I disabled allot of start-up services. So far everything has been ok.

    I’ll keep you guys posted.

    Avatar
    Shazam
    Member
    in reply to: I keep loosing my Ethernet Card Driver #318939

    Re: I’m keep loosing my Ethernet Card Driver.

    Ossian;249610 wrote:
    Does it appear as “unknown” in device manager, or does it actually disappear completely?
    If the latter, what happens if you scan for new hardware?

    I’m thinking something dodgy (loose solder?) on the ethernet section of the Mobo

    It actually disappears completely. Yes, I scan for new hardware and nothing appears.

Viewing 30 posts - 1 through 30 (of 119 total)