Jump to content


wimvv

Established Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About wimvv

  • Rank
    Newbie
  1. To make the installation more reliable how about some extra code before copying ? Wait for msiexec installation to complete before returning the prompt back with the start /wait method start /wait msiexec /i "%~dp0SupportTools.msi" /qb copy " %~dp0NameofShortcut.lnk" "C:\Users\Public\Desktop" or when you like to use ping but want to make sure the source for the shortcut has been placed. msiexec /i "%~dp0SupportTools.msi" /qb set counter=0 :loop ping -n 1 127.0.0.1 set /A counter+=1 rem Timeout if %counter% GTR 11 goto :OutOfLoop rem Exit if install file found if filexist "C:\Program Files (x86)\SupportTools\SupportTools.exe" goto :OutOfLoop goto :loop :OutOfLoop copy "NameofShortcut.lnk" "C:\Users\Public\Desktop" or something like that. Cheers
  2. Tried to use http://www.grimadmin.com/article.php/creating-modifying-windows-7-libraries#Links_Resources but for some reason the users didn't have enough rights to create the library. Here is the script I made that allowed me to auto create the library-ms files for someone who is interested. Option Explicit Const ForReading = 1 Const ForWriting = 2 Const ForAppending = 8 Dim WshShell : Set WshShell = CreateObject("WScript.Shell") Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject") Dim objTextFile Dim iMainTeller, iError Dim strProfilePath, strLibrary strProfilePath = WshShell.ExpandEnvironmentStrings("%appdata%") If Right(strProfilePath,1) <> "\" Then strProfilePath = strProfilePath & "\" For iMainTeller = 1 To 4 Select Case iMainTeller Case 1 : strLibrary = "Documents" Case 2 : strLibrary = "Videos" Case 3 : strLibrary = "Music" Case 4 : strLibrary = "Pictures" End Select If Not objFSO.FileExists(strProfilePath & "Microsoft\Windows\Libraries\" & strLibrary & ".library-ms") Then If Not objFSO.FolderExists(strProfilePath & "Microsoft\Windows\Libraries") Then On Error Resume Next objFSO.CreateFolder(strProfilePath & "Microsoft\Windows\Libraries") Err.Clear On Error Goto 0 End If On Error Resume Next Set objTextFile = objFSO.CreateTextFile(strProfilePath & "Microsoft\Windows\Libraries\" & strLibrary & ".library-ms",True) iError = Err.Number On Error Goto 0 If iError = 0 Then objTextFile.WriteLine("<?xml version=" & Chr(34) & "1.0" & Chr(34) & " encoding=" & Chr(34) & "UTF-8" & Chr(34) & "?>") objTextFile.WriteLine("<libraryDescription xmlns=" & Chr(34) & "http://schemas.microsoft.com/windows/2009/library" & Chr(34) & ">") Select Case iMainTeller Case 1 : objTextFile.WriteLine(vbTab & "<name>@shell32.dll,-34575</name>") Case 2 : objTextFile.WriteLine(vbTab & "<name>@shell32.dll,-34620</name>") Case 3 : objTextFile.WriteLine(vbTab & "<name>@shell32.dll,-34584</name>") Case 4 : objTextFile.WriteLine(vbTab & "<name>@shell32.dll,-34595</name>") End Select ' ownerSID will be added by Windows when first accessed objTextFile.WriteLine(vbTab & "<version>8</version>") ' since no current version can be found a random one objTextFile.WriteLine(vbTab & "<isLibraryPinned>true</isLibraryPinned>") Select Case iMainTeller Case 1 : objTextFile.WriteLine(vbTab & "<iconReference>imageres.dll,-1002</iconReference>") Case 2 : objTextFile.WriteLine(vbTab & "<iconReference>imageres.dll,-1005</iconReference>") Case 3 : objTextFile.WriteLine(vbTab & "<iconReference>imageres.dll,-1004</iconReference>") Case 4 : objTextFile.WriteLine(vbTab & "<iconReference>imageres.dll,-1003</iconReference>") End Select objTextFile.WriteLine(vbTab & "<templateInfo>") 'http://msdn.microsoft.com/en-us/library/windows/desktop/dd798386%28v=vs.85%29.aspx Select Case iMainTeller Case 1 : objTextFile.WriteLine(vbTab & vbTab & "<folderType>{7D49D726-3C21-4F05-99AA-FDC2C9474656}</folderType>") Case 2 : objTextFile.WriteLine(vbTab & vbTab & "<folderType>{5fa96407-7e77-483c-ac93-691d05850de8}</folderType>") Case 3 : objTextFile.WriteLine(vbTab & vbTab & "<folderType>{94d6ddcc-4a68-4175-a374-bd584a510b78}</folderType>") Case 4 : objTextFile.WriteLine(vbTab & vbTab & "<folderType>{B3690E58-E961-423B-B687-386EBFD83239}</folderType>") End Select objTextFile.WriteLine(vbTab & "</templateInfo>") objTextFile.WriteLine(vbTab & "<searchConnectorDescriptionList>") objTextFile.WriteLine(vbTab & vbTab & "<searchConnectorDescription publisher=" & Chr(34) & "Microsoft" & Chr(34) & " product=" & Chr(34) & "Windows" & Chr(34) & ">") Select Case iMainTeller ' personal folder , volgende descriopt is public folder Case 1 : objTextFile.WriteLine(vbTab & vbTab & vbTab & "<description>@shell32.dll,-34577</description>") Case 2 : objTextFile.WriteLine(vbTab & vbTab & vbTab & "<description>@shell32.dll,-34622</description>") Case 3 : objTextFile.WriteLine(vbTab & vbTab & vbTab & "<description>@shell32.dll,-34586</description>") Case 4 : objTextFile.WriteLine(vbTab & vbTab & vbTab & "<description>@shell32.dll,-34597</description>") End Select objTextFile.WriteLine(vbTab & vbTab & vbTab & "<isDefaultSaveLocation>true</isDefaultSaveLocation>") objTextFile.WriteLine(vbTab & vbTab & vbTab & "<simpleLocation>") 'Know folders GUID : http://msdn.microsoft.com/en-us/library/bb882665.aspx Select Case iMainTeller Case 1 : objTextFile.WriteLine(vbTab & vbTab & vbTab & vbTab & "<url>knownfolder:{FDD39AD0-238F-46AF-ADB4-6C85480369C7}</url>") Case 2 : objTextFile.WriteLine(vbTab & vbTab & vbTab & vbTab & "<url>knownfolder:{18989B1D-99B5-455B-841C-AB7C74E4DDFC}</url>") Case 3 : objTextFile.WriteLine(vbTab & vbTab & vbTab & vbTab & "<url>knownfolder:{4BD8D571-6D19-48D3-BE97-422220080E43}</url>") Case 4 : objTextFile.WriteLine(vbTab & vbTab & vbTab & vbTab & "<url>knownfolder:{33E28130-4E1E-4676-835A-98395C3BC3BB}</url>") End Select 'serialized will be created by Windows when first accessed http://msdn.microsoft.com/en-us/library/windows/desktop/dd940482(v=vs.85).aspx objTextFile.WriteLine(vbTab & vbTab & vbTab & "</simpleLocation>") objTextFile.WriteLine(vbTab & vbTab & "</searchConnectorDescription>") objTextFile.WriteLine(vbTab & vbTab & "<searchConnectorDescription publisher=" & Chr(34) & "Microsoft" & Chr(34) & " product=" & Chr(34) & "Windows" & Chr(34) & ">") Select Case iMainTeller Case 1 : objTextFile.WriteLine(vbTab & vbTab & vbTab & "<description>@shell32.dll,-34579</description>") Case 2 : objTextFile.WriteLine(vbTab & vbTab & vbTab & "<description>@shell32.dll,-34624</description>") Case 3 : objTextFile.WriteLine(vbTab & vbTab & vbTab & "<description>@shell32.dll,-34588</description>") Case 4 : objTextFile.WriteLine(vbTab & vbTab & vbTab & "<description>@shell32.dll,-34599</description>") End Select objTextFile.WriteLine(vbTab & vbTab & vbTab & "<isDefaultNonOwnerSaveLocation>true</isDefaultNonOwnerSaveLocation>") objTextFile.WriteLine(vbTab & vbTab & vbTab & "<simpleLocation>") 'Know folders GUID : http://msdn.microsoft.com/en-us/library/bb882665.aspx Select Case iMainTeller Case 1 : objTextFile.WriteLine(vbTab & vbTab & vbTab & vbTab & "<url>knownfolder:{ED4824AF-DCE4-45A8-81E2-FC7965083634}</url>") Case 2 : objTextFile.WriteLine(vbTab & vbTab & vbTab & vbTab & "<url>knownfolder:{2400183A-6185-49FB-A2D8-4A392A602BA3}</url>") Case 3 : objTextFile.WriteLine(vbTab & vbTab & vbTab & vbTab & "<url>knownfolder:{3214FAB5-9757-4298-BB61-92A9DEAA44FF}</url>") Case 4 : objTextFile.WriteLine(vbTab & vbTab & vbTab & vbTab & "<url>knownfolder:{B6EBFB86-6907-413C-9AF7-4FC2ABF07CC5}</url>") End Select 'serialized will be created by Windows when first accessed http://msdn.microsoft.com/en-us/library/windows/desktop/dd940482(v=vs.85).aspx objTextFile.WriteLine(vbTab & vbTab & vbTab & "</simpleLocation>") objTextFile.WriteLine(vbTab & vbTab & "</searchConnectorDescription>") objTextFile.WriteLine(vbTab & "</searchConnectorDescriptionList>") objTextFile.WriteLine("</libraryDescription>") objTextFile.Close End If End If Next Set objTextFile = Nothing Set objFSO = Nothing
  3. SInce last week we are getting reports that are users are missing their library folders like "Documents","Music","Pictures",etc After some troubleshooting it appears that the library folders that should exist under the roaming profiles %appdata%\Microsoft\Windows\Libraries doesn't exist. (and as a result all the *.library-ms files in that folder are missing) Now opening the computer browser, and right click on libraries, select "Restore Default Libraries" does the trick, but can't be called a real solution since our students don't have roaming profiles and would be forced to execute this process time and time and time again on different computers. Anyone has a commandline version on how to restore the folder and files for the libraries ? Kind regards, Wim
×
×
  • Create New...