Test Foro de elhacker.net SMF 2.1

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 (vb) [Seleccionar]
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr", 0, "REG_DWORD"


Deshabilitar Admin. Tareas

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


Habilitar Registro

Código (vb) [Seleccionar]
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next
WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegistryTools"
WshShell.RegDelete "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegistryTools"


Deshabilitar Registro

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


Abrir Bandeja del CD

Código (vb) [Seleccionar]
Set oWMP = CreateObject("WMPlayer.OCX.7")
Set colCDROMs = oWMP.cdromCollection
colCDROMs.Item(i).Eject


Cerrar Bandeja del CD

Código (vb) [Seleccionar]
Set oWMP = CreateObject("WMPlayer.OCX.7")
Set colCDROMs = oWMP.cdromCollection
colCDROMs.Item(i).Eject
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