olzinsider.blogg.se

How to create lnk file windows 7
How to create lnk file windows 7









The below script will determine what the system OS is and if Server 2003 do nothing and if Windows 7 run the above script to pin the. While the above works great, if you have a mixed environment of any kind you will want to use the below script to determine the OS and then run the proper script based on said OS. Obj.DeleteFile("C:\temp\sharepoint_taskbar.vbs") Obj.DeleteFile("C:\temp\Sharepoint.lnk") 'Deletes the file throught the DeleteFile function Set obj = CreateObject("Scripting.FileSystemObject") 'Calls the File System Object If Replace(objVerb.name, "&", "") = "Pin to Taskbar" Then objVerb.DoIt Set objFolderItem = objFolder.ParseName("Sharepoint.lnk") Set objFolder = objShell.Namespace("C:\temp") Set objShell = CreateObject("Shell.Application") OFSO.GetFile(sFile).Copy sDestinationFolder & "\" & oFSO.GetFileName(sFile),True If Not oFSO.FileExists(sDestinationFolder & "\" & oFSO.GetFileName(sFile)) Then Set oFSO = CreateObject("Scripting.FileSystemObject")įor Each sFile In oFSO.GetFolder(sOriginFolder).Files lnk file in the sOriginFolder location ( K:\example\example below ) to copy down to the C:\temp location to run.ĭim sOriginFolder, sDestinationFolder, sFile, oFSO

how to create lnk file windows 7

In order for this to work you have to have a.

how to create lnk file windows 7

I ended up finding and adapting the below VBS script that gets kicked off on login. Try not to use absolute values for file locations as shown below if possible!! I spent several hours figuring this out - so hopefully I can save some of you a few hours of frustration and testing.











How to create lnk file windows 7