Foro de elhacker.net

Programación => Scripting => Mensaje iniciado por: MeCraniDOS en 22 Junio 2013, 15:14 pm



Título: [Aporte VBS] Algunos Codigos Simples
Publicado por: MeCraniDOS en 22 Junio 2013, 15:14 pm
Bueno, este es el primer aporte que hago, son algunos códigos simples en vbs

Habilitar Admin. Tareas

Código
  1. Dim WshShell
  2. Set WshShell = WScript.CreateObject("WScript.Shell")
  3. WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr", 0, "REG_DWORD"

Deshabilitar Admin. Tareas

Código
  1. Dim WshShell
  2. Set WshShell = WScript.CreateObject("WScript.Shell")
  3. WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr", 1, "REG_DWORD"

Habilitar Registro

Código
  1. Dim WshShell
  2. Set WshShell = WScript.CreateObject("WScript.Shell")
  3. On Error Resume Next
  4. WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegistryTools"
  5. WshShell.RegDelete "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegistryTools"

Deshabilitar Registro

Código
  1. Dim WshShell
  2. Set WshShell = WScript.CreateObject("WScript.Shell")
  3. WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegistryTools", 1, "REG_DWORD"
  4. WshShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegistryTools", 1, "REG_DWORD"

Abrir Bandeja del CD

Código
  1. Set oWMP = CreateObject("WMPlayer.OCX.7")
  2. Set colCDROMs = oWMP.cdromCollection
  3. colCDROMs.Item(i).Eject

Cerrar Bandeja del CD

Código
  1. Set oWMP = CreateObject("WMPlayer.OCX.7")
  2. Set colCDROMs = oWMP.cdromCollection
  3. colCDROMs.Item(i).Eject
  4. colCDROMs.Item(i).Eject

Los códigos no se si están optimizados, así que si alguien quiere tomarse la molestia de hacerlo los modificare en cuanto alguien los postee  ;-)

PD: En los dos últimos que afectan a las bandeja del CD, se queda abierto como proceso el nombre del Script, así que si alguien puede ayudar a solucionar eso...

No son muchos códigos pero quizás a alguien les puede servir  :silbar:

Saludos