Página 1 de 1

[Script] VBS para criar atalhos com interação do Usuário

Enviado: 25 Fev 2016 15:12
por marceloleaes
Segue código  ;)

Altere o notepad.exe para qualquer outra aplicação que precisar.

Código: Selecionar todos

' Cria atalhos no Desktop com interação do Usuário
' Retirado do fórum itbr.org
' Por Marcelo Leães - [email protected]

dim r
r = msgbox("Deseja criar um atalho para o Bloco de Notas?", 36, "Criar atalho...")
if r = 7 then
   wscript.quit
else
   Dim oshell, fso
   Set oshell = WScript.CreateObject("WScript.Shell")
   Set fso = CreateObject("Scripting.FileSystemObject")
   Dim shcut, d, dpath, wpath
   
      dpath = oshell.SpecialFolders("Desktop")
      wpath = fso.GetSpecialFolder(0)
   Set shcut = oshell.CreateShortcut(dpath & "\Notepad.lnk")
   shcut.TargetPath = oshell.ExpandEnvironmentStrings(wpath & "\Notepad.exe")
   shcut.WorkingDirectory = oshell.ExpandEnvironmentStrings(wpath)
   shcut.WindowStyle = 4
   shcut.IconLocation = oshell.ExpandEnvironmentStrings(wpath & "\Notepad.exe, 0")
   shcut.Save
end if