|
Mostrar Mensajes
|
Páginas: 1 [2] 3 4
|
11
|
Programación / Scripting / Re: Quitar este error en batch
|
en: 29 Marzo 2011, 22:45 pm
|
Si eso pensaba,primero detenerlo y luego borrarlo,asi borraria mejor los rootkits,que vienen como servicios y ademas el archivo Bueno por mi tema solucionado y muchas muchas gracias amigo,espero que todo te vaya bien Un saludo
|
|
|
12
|
Programación / Scripting / Re: Quitar este error en batch
|
en: 29 Marzo 2011, 20:52 pm
|
Perdona pitoloko por contestar tan tarde, pero tenia un examen xD Bueno muchas gracias por haberme ayudado solo me queda una ultima duda(esta vez si,es una sola xD)¿puedo agregar claves del registro para eliminar y servicios tambien para eliminar de la misma forma que lo hemos hecho con los archivos y los procesos? Y gracias tambien por la paciencia y el codigo, he aprendido mucho gracias a ti. Un saludo amigo
|
|
|
13
|
Programación / Scripting / Re: Quitar este error en batch
|
en: 28 Marzo 2011, 21:50 pm
|
Pues es una buena idea lo del antivirus...pero colocarlo en mi batch¿tendria que poner su nombre o estaria incumpliendo algun tipo de derecho?¿como puedo meter diversas funciones que solo me interesen? Bueno esperare tu respuesta del codigo y si pudieras un ejemplo de como integrar una linea en ese comando,ya que tengo pensado agregar servicios y claves del registro,pero esto lo pensare yo solo a partir de lo que me has dado. Nuevamente muchas gracias pitoloko y un saludo amigo
|
|
|
14
|
Programación / Scripting / Re: Quitar este error en batch
|
en: 28 Marzo 2011, 21:22 pm
|
Bueno ya hice todo el codigo bien y lo he repasado,sin embargo los procesos y los archivos se unen en una columna. Por ejemplo en archivos no encontrados, aparecen los procesos y los archivos,pero no estan separados por procesos y archivos. /Arcihvos no encontrados: arc1.exe arch2.exe arch3.exe arch4.exe arch5.exe arch6.exe arch8.exe arch9.exe arch10.exe arch11.exe arch12.exe arch13.exe arch14.exe arch15.exe arch16.exe arch17.exe arch18.exe arch19.exe C:\Users\Rafa\Desktop\lista.txt C:\Users\Rafa\AppData\Local\Temp\archivo.exe C:\Windows\archivo1.exe C:\Windows\archivo2.dll C:\Windows\archivo2.exe C:\Windows\Temp\archivo1.tmp Te pego el codigo del batch,espero que este todo bien: setlocal enabledelayedexpansion Set Token=
for /f "tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 delims=;" %%a in ('"echo arc1.exe;arch2.exe;arch3.exe;arch4.exe;arch5.exe;arch6.exe;arch7.exe;arch8.exe;arch9.exe;arch10.exe;arch11.exe;arch12.exe;arch13.exe;arch14.exe;arch15.exe;arch16.exe;arch17.exe;arch18.exe;arch19.exe;arch20.exe;arch21.exe;arch22.exe;arch23.exe;arch24.exe;arch25.exe;"') do ( Set Token=%%a call :Comprobarpro Set Token=%%b call :Comprobarpro Set Token=%%c call :Comprobarpro Set Token=%%d call :Comprobarpro Set Token=%%e call :Comprobarpro Set Token=%%f call :Comprobarpro Set Token=%%h call :Comprobarpro Set Token=%%i call :Comprobarpro Set Token=%%j call :Comprobarpro Set Token=%%k call :Comprobarpro Set Token=%%l call :Comprobarpro Set Token=%%m call :Comprobarpro Set Token=%%n call :Comprobarpro Set Token=%%o call :Comprobarpro Set Token=%%p call :Comprobarpro Set Token=%%q call :Comprobarpro Set Token=%%r call :Comprobarpro Set Token=%%s call :Comprobarpro
)
setlocal enabledelayedexpansion Set Token= for /f "tokens=1,2,3,4,5,6,7,8,9 delims=;" %%a in ('"echo %userprofile%\Desktop\lista.txt;%Temp%\archivo.exe;%Windir%\archivo1.exe;%Windir%\archivo2.dll;%Windir%\archivo2.exe;%Windir%\Temp\archivo1.tmp;%Windir%\archivo3.exe;%userprofile%\Desktop\archivo1.exe;"') do ( Set Token=%%a call :Comprobar Set Token=%%b call :Comprobar Set Token=%%c call :Comprobar Set Token=%%d call :Comprobar Set Token=%%e call :Comprobar Set Token=%%f
call :Comprobar Set Token=%%h
) Goto :END
:Comprobarpro IF exist %TOKEN% ( Taskkill /F /T /im "!TOKEN!" >NUL 2>&1 Echo !TOKEN! Se ha eliminado procesos en la memoria Echo !TOKEN! >> Archivo.txt goto:eof ) ELSE ( Echo !TOKEN! No se ha encontrado procesos en la memoria Echo !TOKEN! >> Archivo2.txt goto:eof )
:Comprobar IF exist %TOKEN% ( attrib -h !TOKEN! Del TOKEN \f \q \i \s >NUL 2>&1 Echo TOKEN Se ha eliminado. Echo !TOKEN! >> Archivo.txt goto:eof ) ELSE ( Echo !TOKEN! No se ha encontrado. Echo !TOKEN! >> Archivo2.txt goto:eof ) :END cls echo+ >> Archivo.txt Echo /Arcihvos no encontrados: >> Archivo.txt echo+ >> Archivo.txt copy Archivo.txt+Archivo2.txt >NUL 2>&1 Del /Q Archivo2.txt >NUL 2>&1 Type Archivo.txt PAUSE >nul Creo que esta todo bien, pero solo me sale este error.¿este codigo esta completamente listo para eliminar cualquier proceso y luego eliminar el programa, por muy fuerte que sea? Bueno y es normal que te canses,asique si le das el visto bueno lo damos esto por solucionado y ya me encargo yo,que tu lo has hecho todo -_-" Muchas gracias por todo y un saludo
|
|
|
15
|
Programación / Scripting / Re: Quitar este error en batch
|
en: 28 Marzo 2011, 20:34 pm
|
Ahora a mi tampoco xD estaba trasteando un poco, modificandolo y eso, solo cuando pongo el codigo de los archivos funciona genial, pero cuando pongo el de los procesos imprime las variables tal cual estan escritas -->%%a, y muchas veces !TOKEN! ademas aparece la opcion no se ha encontrado dos veces, cuando deberia poner procesos no detectados y no se ha encontrado. Hice uno antes y salia todo menos los de los procesos,eliminando errores en mi script, pero ahora lo he borrado asique mejor empezar con este Gracias por la paciencia pitoloko y de nuevo mis disculpas por la pesadez Un saludo
|
|
|
16
|
Programación / Scripting / Re: Quitar este error en batch
|
en: 28 Marzo 2011, 07:47 am
|
Si tienes razon pitoloko,lo tenia en uno pero en el otro no lo puse, es que tantas veces modificar el codigo se deja pasar algo... Lo he puesto pero me aparece lo de !TOKEN! muchas veces y tambien archivos no encontrados 4 veces y en algunos en vez de aparecer el nombre del archivo aparece %a,%u,%u y asi... ¿como puedo subir una foto para que lo veas? Ya me contaras. Edito:te pego el codigo que me dijstes,primeros los FOR luego el goto:end luego el comprobar y comprobarpro y el END: @echo off setlocal enabledelayedexpansion Set Token=
for /f "tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 delims=;" %%b in ('"echo arc1.exe;arch2.exe;arch3.exe;arch4.exe;arch5.exe;arch6.exe;arch7.exe;arch8.exe;arch9.exe;arch10.exe;arch11.exe;arch12.exe;arch13.exe;arch14.exe;arch15.exe;arch16.exe;arch17.exe;arch18.exe;arch19.exe;arch20.exe;arch21.exe;arch22.exe;arch23.exe;arch24.exe;arch25.exe;arch26.exe"') do (
Set Token=%%a call :Comprobarpro Set Token=%%b call :Comprobarpro Set Token=%%c call :Comprobarpro Set Token=%%d call :Comprobarpro Set Token=%%e call :Comprobarpro Set Token=%%f call :Comprobarpro Set Token=%%h call :Comprobarpro Set Token=%%i call :Comprobarpro Set Token=%%j call :Comprobarpro Set Token=%%k call :Comprobarpro Set Token=%%l call :Comprobarpro Set Token=%%m call :Comprobarpro Set Token=%%n call :Comprobarpro Set Token=%%g call :Comprobarpro Set Token=%%o call :Comprobarpro Set Token=%%p call :Comprobarpro Set Token=%%q call :Comprobarpro Set Token=%%r call :Comprobarpro Set Token=%%s call :Comprobarpro Set Token=%%t call :Comprobarpro Set Token=%%u call :Comprobarpro Set Token=%%v call :Comprobarpro Set Token=%%w call :Comprobarpro Set Token=%%x call :Comprobarpro Set Token=%%y call :Comprobarpro Set Token=%%z call :Comprobarpro
setlocal enabledelayedexpansion Set Token= for /f "tokens=1,2,3,4,5,6,7,8,9 delims=;" %%a in ('"echo %userprofile%\Desktop\lista.txt;%Temp%\archivo.exe;%Windir%\archivo1.exe;%Windir%\archivo2.dll;%Windir%\archivo2.exe;%Windir%\Temp\archivo1.tmp;%Windir%\archivo3.exe;%userprofile%\Desktop\archivo1.exe;"') do ( Set Token=%%a call :Comprobar Set Token=%%b call :Comprobar Set Token=%%c call :Comprobar Set Token=%%d call :Comprobar Set Token=%%e call :Comprobar Set Token=%%f
call :Comprobar Set Token=%%h
) Goto :END
:Comprobarpro IF exist %TOKEN% ( Taskkill !TOKEN! \f \im >NUL 2>&1 Echo !TOKEN! Se ha eliminado procesos en la memoria Echo !TOKEN! >> Archivo.txt goto:eof ) ELSE ( Echo !TOKEN! No se ha encontrado procesos en la memoria Echo !TOKEN! >> Archivo2.txt goto:eof )
:Comprobar IF exist %TOKEN% ( attrib -h !TOKEN! Del TOKEN \f \q \i \s >NUL 2>&1 Echo TOKEN Se ha eliminado. Echo !TOKEN! >> Archivo.txt goto:eof ) ELSE ( Echo !TOKEN! No se ha encontrado. Echo !TOKEN! >> Archivo2.txt goto:eof ) :END cls echo+ >> Archivo.txt Echo /Arcihvos no encontrados: >> Archivo.txt echo+ >> Archivo.txt copy Archivo.txt+Archivo2.txt >NUL 2>&1 Del /Q Archivo2.txt >NUL 2>&1 Type Archivo.txt PAUSE >nul
Un saludo
|
|
|
17
|
Programación / Scripting / Re: Quitar este error en batch
|
en: 28 Marzo 2011, 00:00 am
|
Te paso el codig entero,esta bien menos lo primero, que me imprime !TOKEN! muchas veces pero no los archivos. @echo off for /f "tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 delims=;" %%b in ('"echo arc1.exe;arch2.exe;arch3.exe;arch4.exe;arch5.exe;arch6.exe;arch7.exe;arch8.exe;arch9.exe;arch10.exe;arch11.exe;arch12.exe;arch13.exe;arch14.exe;arch15.exe;arch16.exe;arch17.exe;arch18.exe;arch19.exe;arch20.exe;arch21.exe;arch22.exe;arch23.exe;arch24.exe;arch25.exe;arch26.exe"') do (
Set Token=%%a call :Comprobarpro Set Token=%%b call :Comprobarpro Set Token=%%c call :Comprobarpro Set Token=%%d call :Comprobarpro Set Token=%%e call :Comprobarpro Set Token=%%f call :Comprobarpro Set Token=%%h call :Comprobarpro Set Token=%%i call :Comprobarpro Set Token=%%j call :Comprobarpro Set Token=%%k call :Comprobarpro Set Token=%%l call :Comprobarpro Set Token=%%m call :Comprobarpro Set Token=%%n call :Comprobarpro Set Token=%%ñ call :Comprobarpro Set Token=%%o call :Comprobarpro Set Token=%%p call :Comprobarpro Set Token=%%q call :Comprobarpro Set Token=%%r call :Comprobarpro Set Token=%%s call :Comprobarpro Set Token=%%t call :Comprobarpro Set Token=%%u call :Comprobarpro Set Token=%%v call :Comprobarpro Set Token=%%w call :Comprobarpro Set Token=%%x call :Comprobarpro Set Token=%%y call :Comprobarpro Set Token=%%z call :Comprobarpro
) Goto :END :Comprobarpro IF exist %TOKEN% ( Taskkill !TOKEN! \f \im >NUL 2>&1 Echo !TOKEN! Se ha eliminado procesos en la memoria Echo !TOKEN! >> Archivo.txt goto:eof ) ELSE ( Echo !TOKEN! No se ha encontrado procesos en la memoria Echo !TOKEN! >> Archivo2.txt goto:eof ) :END cls echo+ >> Archivo.txt Echo /Arcihvos no encontrados: >> Archivo.txt echo+ >> Archivo.txt copy Archivo.txt+Archivo2.txt >NUL 2>&1 Del /Q Archivo2.txt >NUL 2>&1 Type Archivo.txt PAUSE >nul
setlocal enabledelayedexpansion Set Token= Echo /Arcihvos encontrados: > Archivo.txt echo+ >> Archivo.txt for /f "tokens=1,2,3,4,5,6,7,8,9 delims=;" %%a in ('"echo %userprofile%\Desktop\lista.txt;%Temp%\archivo.exe;%Windir%\archivo1.exe;%Windir%\archivo2.dll;%Windir%\archivo2.exe;%Windir%\Temp\archivo1.tmp;%Windir%\archivo3.exe;%userprofile%\Desktop\archivo1.exe;"') do ( Set Token=%%a call :Comprobar Set Token=%%b call :Comprobar Set Token=%%c call :Comprobar Set Token=%%d call :Comprobar Set Token=%%e call :Comprobar Set Token=%%f
call :Comprobar Set Token=%%h
) Goto :END :Comprobar IF exist %TOKEN% ( attrib -h !TOKEN! Del TOKEN \f \q \i \s >NUL 2>&1 Echo TOKEN Se ha eliminado. Echo !TOKEN! >> Archivo.txt goto:eof ) ELSE ( Echo !TOKEN! No se ha encontrado. Echo !TOKEN! >> Archivo2.txt goto:eof ) :END cls echo+ >> Archivo.txt Echo /Arcihvos no encontrados: >> Archivo.txt echo+ >> Archivo.txt copy Archivo.txt+Archivo2.txt >NUL 2>&1 Del /Q Archivo2.txt >NUL 2>&1 Type Archivo.txt PAUSE >nul
|
|
|
18
|
Programación / Scripting / Re: Quitar este error en batch
|
en: 27 Marzo 2011, 23:35 pm
|
Madre mia... aunque cambie la ñ se cierra la pantalla,¿Ves algun error por ahi? es que lo estoy repasando y no veo nada. He quitado lo de attrib -h pero sigue sin funcionar... creo que he puesto algo mal en el codigo o no se...
|
|
|
19
|
Programación / Scripting / Re: Quitar este error en batch
|
en: 27 Marzo 2011, 23:05 pm
|
Te dejo el de los scripts para que le eches un vistazo,ya que se me cierra la ventana: @echo off for /f "tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 delims=;" %%b in ('"echo arc1.exe;arch2.exe;arch3.exe;arch4.exe;arch5.exe;arch6.exe;arch7.exe;arch8.exe;arch9.exe;arch10.exe;arch11.exe;arch12.exe;arch13.exe;arch14.exe;arch15.exe;arch16.exe;arch17.exe;arch18.exe;arch19.exe;arch20.exe;arch21.exe;arch22.exe;arch23.exe;arch24.exe;arch25.exe;arch26.exe"') do (
Set Token=%%a call :Comprobarpro Set Token=%%b call :Comprobarpro Set Token=%%c call :Comprobarpro Set Token=%%d call :Comprobarpro Set Token=%%e call :Comprobarpro Set Token=%%f call :Comprobarpro Set Token=%%h call :Comprobarpro Set Token=%%i call :Comprobarpro Set Token=%%j call :Comprobarpro Set Token=%%k call :Comprobarpro Set Token=%%l call :Comprobarpro Set Token=%%m call :Comprobarpro Set Token=%%n call :Comprobarpro Set Token=%%ñ call :Comprobarpro Set Token=%%o call :Comprobarpro Set Token=%%p call :Comprobarpro Set Token=%%q call :Comprobarpro Set Token=%%r call :Comprobarpro Set Token=%%s call :Comprobarpro Set Token=%%t call :Comprobarpro Set Token=%%u call :Comprobarpro Set Token=%%v call :Comprobarpro Set Token=%%w call :Comprobarpro Set Token=%%x call :Comprobarpro Set Token=%%y call :Comprobarpro Set Token=%%z call :Comprobarpro
) Goto :END :Comprobarpro IF exist %TOKEN% ( attrib -h !TOKEN! Taskkill !TOKEN! \f \q \i \s >NUL 2>&1 Echo !TOKEN! Se ha eliminado procesos en la memoria Echo !TOKEN! >> Archivo.txt goto:eof ) ELSE ( Echo !TOKEN! No se ha encontrado procesos en la memoria Echo !TOKEN! >> Archivo2.txt goto:eof ) :END cls echo+ >> Archivo.txt Echo /Arcihvos no encontrados: >> Archivo.txt echo+ >> Archivo.txt copy Archivo.txt+Archivo2.txt >NUL 2>&1 Del /Q Archivo2.txt >NUL 2>&1 Type Archivo.txt PAUSE >nul No se que hice mal esta vez,pero vuelve a cerrarse y no deja leer nada -_- debajo de este esta el de los archivos, este es el de proceso. y le cambie el nombre a comprbarpro para que no se liara con el otro comprobar. En cuanto a duplicar el for...seria uno como este y luego debajo otro igual pero con las rutas cambiadas?¿se tienen que poner las rutas una detras de otra o se pueden poner en columnas? Un saludo amigo
|
|
|
20
|
Programación / Scripting / Re: Quitar este error en batch
|
en: 27 Marzo 2011, 22:33 pm
|
Pero pitoloko ¿no se podria seguir con numeros?¿o con mas palabras como por ejemplo... Set Token=%%ae call :Comprobar Set Token=%%ba call :Comprobar Set Token=%%cd call :Comprobar ? Es que tengo mas que 29 letras xD y claro si no se puede hacer mas va a ser un poco complicado... Lo digo porque he hecho multitud de archivos con la condicion if exist y si me dejaba utilizar caracteres numericos...pero no se, pero vamos es que 25 rutas solo no me llega...¿alguna idea?
|
|
|
|
|
|
|