elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Como proteger una cartera - billetera de Bitcoin


  Mostrar Temas
Páginas: [1]
1  Programación / Scripting / problema al asignar variables dentro un bucle en: 14 Agosto 2013, 23:46 pm
amigos, hace mucho tiempo que vengo leyendo sus ayudas, y me han servido de mucho, ahora me toco a mi el problema, tengo el siguiente código:

Código
  1. reg query "HKLM\Software\Microsoft\Microsoft SQL Server\Instance Names\SQL"|find /V "!" |find /V "HKEY_LOCAL_MACHINE" |find /V "MSSQLSERVER" |gawk '{print $1}'  > %TMP%\inst.log
  2.  
  3. type %TMP%\inst.log |find /v /c "" > %TMP%\CNT
  4. set /P CNT=<%TMP%\CNT
  5.  
  6. if %CNT% EQU 2 (
  7. osql -E -Q"select @@version" -o%TMP%\Est_Inst.inst
  8.  
  9. type %TMP%\Est_INst.inst |find /v /c "" > %TMP%\CNT
  10. set /P CNT=<%TMP%\CNT
  11. echo %CNT%
  12.  
  13. if %CNT% EQU 21 (echo NOOK %date%_%time% >> %TMP%\EST_INST.lg) ELSE (echo OK %date%_%time% >> %TMP%\EST_INST.lg)
  14.  
  15. ) ELSE (for /f %i in (%TMP%\inst.log) do (
  16. osql -E -S%SRV%\%i -Q"select @@version" -o%TMP%\Est_Inst.inst
  17.  
  18. type %TMP%\Est_INst.inst |find /v /c "" > %TMP%\CNT
  19. set /P CNT=<%TMP%\CNT
  20. echo %CNT%
  21.  
  22. if %CNT% NEQ 21 (echo NOOK %i >> %TMP%\EST_INST.lg) ELSE (echo OK >> %TMP%\EST_INST.lg)
  23. )
  24. )


el problema se me genera al momento de asignar los valores dentro del bucle, a pesar de que cuenta las líneas, no es capaz de pasarle el valor a la variable, por favor una mano, ya no se me ocurre nada =/
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines