BandaAncha.eu

  • 🔍 en 📰 artículos ⏎
  • 🔍 en 💬 foros ⏎
  • 🔍 en 👇 este 💬 foro ⏎
  • 🔍 en 👇 este 💬 tema ⏎
Regístrate Regístrate Identifícate Identifícate

script vbs , borrar carpeta entera + ejecutar .exe

BocaDePez
BocaDePez

estoy intentando hacer un script con vbs ya que el bat no me gusta mucho pero no consigo que me funcione con el patch absoluto solo con el relativo

es decir:

Set variable = CreateObject("Scripting.FileSystemObject")
variable.DeleteFolder "D:\directorio\Cache"
Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("ejecutable.exe", 1, true)

Logicmaente el script.vbs debe estar dentro de la carpeta del ejecutable.exe

si lo pongo asi, si que me funciona, en cambio si quiero poner la ruta completa del ejecutable

Set variable = CreateObject("Scripting.FileSystemObject")
variable.DeleteFolder "D:\directorio\Cache"
Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("D:\ejecutable.exe", 1, true)

alguna idea de porque no llega a arancar

WiLZy

Para lanzar los ejecutables yo uso:

Dim WshShell, oExec

Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("\\servidor\ruta$\dir1\ejecutable.exe")

Es una ruta UNC pero entiendo que funcionará con rutas absolutas también.

🗨️ 1
BocaDePez
BocaDePez

gracias me sirvio perfectamente, ahorra a ponerlo en funcioanmiento con una casilla de confirmacion al borrar la carpeta cache, gracias nuevamente