They aren't developers and aren't power users, so they don't have any admin rights. No one have the ability to install something. I'm administering nearly 500 school-PC with over 1500 student. Guys, that is an absolutely wrong way! Not only sysadmin-level pro developers using VS Code. by default automatic updates wouldn't workīoth of these problems are fixed if you grant Full Control to of the Program Files folder to all Users.it would require the users to be administrators.I don't know if Windows Defender will complain about saving to that location. You will either need to allow script.exe to make changes to the desktop, or save the shortcut elsewhere.Īlthough, I have not tested this on the objWscriptShell.SpecialFolders("AllUsersDesktop") You can put this script in a Logon group policy and the end user will get VSCode deployed to their machine.Įdit: One caveat with the Desktop as the destination for the shortcut is, Windows Defender Protected Folders. I have tested this with files on my local machine and it works. If objFSO.FileExists(VSCode_DesktopShortCut) Then objFSO.DeleteFile VSCode_DesktopShortCut, True If Not objFSO.FileExists(VSCode_DesktopShortCut) Then Set lnk = objWscriptShell.CreateShortcut(VSCode_DesktopShortCut) lnk.targetpath = VSCode_FullExecutable lnk.IconLocation = VSCode_FullExecutable & ",0" lnk.Description = "Best Text Editor Ever" lnk.WorkingDirectory = UnzipDir lnk.save End If Option Explicit Dim objFSO, objWscriptShell, objShellApplication Dim ZipFile, UnzipDir, FilesInZip Set objFSO = CreateObject( "Scripting.FileSystemObject" ) Set objWscriptShell = CreateObject( "WScript.Shell" ) Set objShellApplication = CreateObject( "Shell.Application" ) ZipFile = "\\server01\some\accessible\share\VSCode-win32-圆4-1.36.1.zip" UnzipDir = "C:\path\on\local\machine" ' Make sure the directory we are extracting to exists If Not objFSO.FolderExists(UnzipDir) Then objFSO.CreateFolder(UnzipDir) Set FilesInZip = objShellApplication.NameSpace(ZipFile).items objShellApplication.NameSpace(UnzipDir).CopyHere(FilesInZip) ' Create the shortcut Dim VSCode_ShortCutName, VSCode_DesktopShortCut, VSCode_FullExecutable, lnk VSCode_ShortCutName = "Visual Studio Code.lnk" VSCode_DesktopShortCut = objWscriptShell.SpecialFolders( "desktop" ) & "\" & VSCode_ShortCutName VSCode_FullExecutable = UnzipDir & "\Code.exe" ' Reset the shortcut every time this script is run.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |