PDA

View Full Version : Unire due .vbs


Eress
10-11-2015, 19:20
Come da titolo, come si fa ad unire due task vbs in uno solo? Gli asterischi dividono i due task. Qualcuno sa come fare?
' Desktop.vbs - to Refresh Icons on the Desktop
' Example VBScript to re-activate the Desktop Shell
' Author Jeremy H. & Guy Thomas http://computerperformance.co.uk/
' Version 2.1 - October 2005
' -------------------------------------------------------------'
SET WshShell = CreateObject("WScript.Shell")

SET oExec=WshShell.Exec("taskkill /F /T /IM programxxx.exe")

SET oExec= Nothing

SET WshShell =Nothing

*****************
Option Explicit
Dim WSHShell, strDesktop
Set WSHShell = WScript.CreateObject("WScript.Shell")
strDesktop = WSHShell.SpecialFolders("Desktop")
WSHShell.AppActivate strDesktop
WSHShell.SendKeys "{F5}"
WScript.Quit

' End of VBScript to refresh the desktop

x_Master_x
10-11-2015, 21:36
Option Explicit
Dim WshShell, strDesktop, oExec
Set WshShell = WScript.CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("taskkill /F /T /IM programxxx.exe")
strDesktop = WshShell.SpecialFolders("Desktop")
WshShell.AppActivate strDesktop
WshShell.SendKeys "{F5}"
Set oExec = Nothing
Set WshShell = Nothing
Set strDesktop = Nothing
WScript.Quit

Eress
11-11-2015, 05:56
Grazie Master, lo sto testando, sembra funzionare bene. In effetti ho scoperto anche che lo script di aggiornamento desktop, basta trascinarlo su desktop e agisce. I vbs comunque, sono molto pių potenti dei batch.

x_Master_x
11-11-2015, 09:32
Il VBScript č sicuramente pių potente dei batch e tra i due č quello che pių si avvicina ad un linguaggio di programmazione. Powershell avrebbe dovuto sostituire i batch anni fa ma Microsoft non ha mai preso e ancora deve prendere questa decisione.