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


Tema destacado: Rompecabezas de Bitcoin, Medio millón USD en premios


  Mostrar Mensajes
Páginas: 1 ... 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 [810] 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 ... 1254
8091  Programación / .NET (C#, VB.NET, ASP) / Re: [SOURCE] mrtzcmp3 Downloader en: 26 Octubre 2013, 18:31 pm
no se porque parece que ocupa más memoria RAM...

Un RegEx reserva más memoria y es lento en comparación, tarda más en inicializarse y en finalizar su ejecución (Lease las diferentes RegExOptions para ajustar un poco estas caracteristicas).

Según un test de velocidad que acabo de realizar para decodificar 1.000.000 de strings, estos han sido los resultados:

Código:
Método 1 (Regex.Replace): 11.826 segundos 
Método 2 (String Append): 6.201 segundos

Óbviamente, para procesar una efímera cantidad de urls, no importa en absoluto que método se use ya que la diferencia en ms no se podrá apreciar.

Saludos.
8092  Programación / Programación General / Re: Archivo bat Windows 7 en: 26 Octubre 2013, 18:12 pm
Hola

¿Seriáis tan amables de proporcionarme una solución?

1. Las variables especiales de FOR solo pueden contener un caracter, y van del rango A-Z plus algunos caracteres especiales:
Código:
%%A

2. Hay varios tipos de FOR, para procesar un rango número se usa el modificador /L:
Código:
FOR /L

3. La sintaxis del comando Start es:
Código:
START "Título" "Proceso"
Código
  1. START "" "PracticaSSIIBat.exe argumentos"

4. Porfavor, usa las etiquetas para añadir código, y postea las dudas de Batch en el subforo de Scripting.


He probado varias cosas pero nada funciona.

Se denota que has probado de todo pero no has probado a leer un manual básico del lenguaje.

Saludos!
8093  Sistemas Operativos / Windows / Re: como editar mi sistema operativo windows ! en: 26 Octubre 2013, 17:46 pm
Citar
Hey en donde encuentro un manual de esos???

Si lo quieres en Castellano entonces puedes encontrar tutoriales en el buscador de cualquier foro de temática Hacking como este... aunque, ya sabes lo que te vas a encontrar (contenido cutre, en la mayoría de los casos son documentos redactados por gente que no sabe lo suficiente sobre lo que está escribiendo).

Si lo quieres en Inglés, también tienes una grandiosa cantidad donde elegir... desde libros en Amazon como tutoriales online:
-> http://www.tenouk.com/ModuleO.html
Ese es bueno, y arriba del todo de la página tienes los botones para pasar las páginas de los módulos.



Citar
puedes contestar unas preguntas sobre windows 8:

Pues me lo he pensado, no soy un Bot ni me pagan por contestar, pero ...está bien xD



Citar
1) Hay alguna forma de poner un menu de inicio similar al de windows 7??

No me andaré con rodeos, hay muchos, pero StartIsBack es el mejor (en mi opinión).
-> http://www.startisback.com/



Citar
2) Porque hay drivers que no funcionan de igual manera en windows 8 como lo han hecho con windows 7?
tenia entendido que si funcionaba, pero me lleve una sorpresa al instalar los sims 3, no me reconocia la tarjeta, tenia que jugar con las menores caracteristicas, usando una Ati Radeon HD 6450, y pues bueno, en windows 7 funcionaba fenomenal.

No puedo contestarte con seguridad, no soy un experto en Hardware, pero ya sabes como es el tema de la compatibilidad cuando sale a la luz una nueva generación de Windows (generación, no versión).

(Imagino que ya habrás probado a activar la compatibilidad de programas de Windows para especificar que el proceso corría bien en Windows 7)

Quizás exista alguna actualización/parche/bugfix de compatibilidad en la página oficial de los Sims para Windows 8, o puedes intnetar actualizar los drivers de tu ATI.



Citar
3) Tienes pensado hacer un post grandiosos para Activar-Desactivar caracteristicas en windows 8??

-> By Elektro H@cker - Tips interesantes que deberías conocer para exprimir Windows 8

-> By Elektro H@cker - Menúes en cascada para Windows 8

:)



Citar
Hablando de eso, mira, tuve problemas instalando, puede que ya haya preguntado, pero fue hace rato, y como volvi a windows 7, usando el paquete que nos regalaste Mega-Pack Tips Windows 7 x64 (un regalo de los dioses, sos grande, muchas gracias maese) me sale lo siguiente cuando trato de instalar todas las herramientas:

No tienes de que preocuparte, en los scripts yo usaba la aplicación NIRCMD para centrar la ventana de la CMD a la pantalla y para detener la ejecución del script, pero como tu no dispones de la aplicación sale ese mensaje de error.

reemplaza:
Código:
nircmd wait 500 
por:
Código:
Timeout /T 1 1>NUL

Citar
4) Y ultima pregunta: Windows 7 (Completamente Actualizado + Mega-Pack Tips Windows 7 x64) vs Paquete de vs Windows 8.1 (Completamente Actualizado, olvidando esa idiotez de la tablet para dummies)???

Si me das a elegir entre windows 8.1 o 7, y suponiendo que te vayas a instalar la orbe de inicio, entonces sin lugar a dudas Windows 8.1.

Pero si eres muy Gamer de los Sims y no puedes solucionar el inconveniente de la compatibilidad pues no se... es tu decisión no la mia!

(No me voy a poner a explicar ventajas entre win8 y win7 si es lo que buscas, ya hay posts de eso donde yo y tros compañeros han comentado en el foro xD)

Un saludo!
8094  Sistemas Operativos / Windows / Re: [APORTE] Tips interesantes que deberías conocer para exprimir Windows 8 en: 26 Octubre 2013, 17:45 pm
Revivo este post para añadir un script al que lo llamo "Perfil de Sistema", a petición para el usuario dato000

Esto es un script que corro (en conjunto con otro tipo de utilidades) después de una instalación de Windows 8 para preconfigurar (añadir, modificar o eliminar) muchas caracteristicas de Windows 8 relacionadas con el SO, el Explorer, Panel de control, menú contextual, dispositivos, redes, etc...

Esto lo comparto para que examinen las caracteristicas que modifico (Leasen los "Echo" dentro del script), y eliminen las caracteristicas que no quieren modificar, hagan lo que quieran con esto xD.

PD: Porfavor, no ejecutar el archivo sin mirarlo detalládamente, hay cosas que quizas no quieran o no deban desactivar, como por ejemplo los servicios de sus dispositivos de redes, las DNS de Google, o el salvapantallas preconfigurado.
PD2: No hay peligro de ningún tipo, pero ya saben, si no se lo miran antes de ejecutarlo pueden perder la conectividad de red por lo que he mencionado en la postdata 1,
no me hago responsable del mal uso de este script.



Código:
@Echo OFF

Title Perfil de sistema por defecto (By Elektro H@cker^)


Echo+
Echo :: ###############
Echo :: Barra de tareas
Echo :: ###############
Echo+

Echo [+] Desagrupar iconos del system tray
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /V "EnableAutoTray" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1

Echo [+] No agrupar las instancias del mismo programa
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /V "TaskbarGlomLevel" /T "REG_DWORD" /D "0x00000002" /F >NUL 2>&1

Echo [+] Ocultar la barra de Idioma
REG ADD "HKLM\Software\Microsoft\CTF\LangBar" /V "ShowStatus" /T "REG_DWORD" /D "0x00000003" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\CTF\LangBar" /V "ShowStatus" /T "REG_DWORD" /D "0x00000003" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\CTF\LangBar" /V "LABEL" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\CTF\MSUTB\DontShowCloseLangBarDlg" /V "LABEL" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Desactivar las notificaciones del "Centro de seguridad"
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /V "HideSCAHealth" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /V "HideSCAHealth" /F >NUL 2>&1


Echo+
Echo :: :: ###
Echo :: :: CMD
Echo :: :: ###
Echo+

Echo [+] Codificacion
REG ADD "HKCU\Software\Microsoft\Command Processor" /V "Autorun" /T "REG_SZ" /D "chcp 1252 >NUL 2>&1" /F >NUL 2>&1

Echo [+] Fuente
rem REG ADD HKCU\Console\^%%SystemRoot^%%_system32_cmd.exe /V "FaceName" /T "REG_SZ" /D "Lucida Console" /F >NUL 2>&1
rem REG ADD HKCU\Console\^%%SystemRoot^%%_system32_cmd.exe /V "FontSize" /T "REG_DWORD" /D "0x000e0000" /F >NUL 2>&1
rem REG ADD HKCU\Console\^%%SystemRoot^%%_system32_cmd.exe /V "FontFamily" /T "REG_DWORD" /D "0x00000036" /F >NUL 2>&1

Echo [+] Color de texto
REG ADD HKCU\Console\^%%SystemRoot^%%_system32_cmd.exe /V "ScreenColors" /T "REG_DWORD" /D "0x00000007" /F >NUL 2>&1

Echo [+] Capacidad del buffer
REG ADD HKCU\Console\^%%SystemRoot^%%_system32_cmd.exe /V "HistoryBufferSize" /T "REG_DWORD" /D "0x00000096" /F >NUL 2>&1
REG ADD HKCU\Console\^%%SystemRoot^%%_system32_cmd.exe /V "NumberOfHistoryBuffers" /T "REG_DWORD" /D "0x00000006" /F >NUL 2>&1

Echo [+] Modo de edicion rapida
REG ADD HKCU\Console\^%%SystemRoot^%%_system32_cmd.exe /V "QuickEdit" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Variable de entorno "DOWNLOADS"
SETX Downloads "%userprofile%\Downloads" >NUL 2>&1

Echo+
Echo :: ########
Echo :: Explorer
Echo :: ########
Echo+

Echo [+] Desocultar carpeta "%Programdata%"
attrib -h "%Programdata%"

Echo [+] Desocultar carpeta "%appdata%"
attrib -h "%appdata%"

Echo [+] Ocultar carpeta "%public%"
attrib +h "%public%"

Echo [+] Activar las casillas para seleccionar elementos
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /V "AutoCheckSelect" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Desactivar controladores de vista previa en el panel de vista previa
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /V "ShowPreviewHandlers" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1

Echo [+] Desactivar el asistente para compartir en carpetas
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /V "SharingWizardOn" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1

Echo [+] Desactivar el panel de navegacion
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Modules\GlobalSettings\Sizer" /V "PageSpaceControlSizer" /T "REG_BINARY" /D "a000000000000000000000001c010000" /F >NUL 2>&1

Echo [+] Desactivar la carpeta Librerias
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{031E4825-7B94-4dc3-B131-E946B44C8DD5}" /F >NUL 2>&1

Echo [+] Deshabilitar la busqueda automatica de carpetas compartidas y equipos de red
for /F "delims= " %%a in ('"wmic useraccount where name='%UserName%' get sid" ^| MORE +1') do (
reg add "HKEY_USERS\%%a\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "NoNetCrawling" /T "REG_DWORD" /D "1" /F >NUL 2>&1
)

Echo [+] Establecer perfil de vista de "Archivos generales" para todas las carpetas
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell" /V "FolderType" /T "REG_SZ" /D "NotSpecified" /F >NUL 2>&1

Echo [+] Mostrar archivos protegidos del sistema
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /V "ShowSuperHidden" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Mostrar las extensiones de archivos
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /V "HideFileExt" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1

Echo [+] Ocultar menus en las carpetas
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /V "AlwaysShowMenus" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Ocultar unidades de disco vacias en la carpeta Equipo
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /V "HideDrivesWithNoMedia" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Ocultar este PC en el explorador de equipos de una PC remota
REG ADD "HKLM\SYSTEM\ControlSet001\services\LanmanServer\Parameters" /V "Hidden" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1
REG ADD "HKLM\SYSTEM\ControlSet002\services\LanmanServer\Parameters" /V "Hidden" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1
REG ADD "HKLM\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters" /V "Hidden" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Permitir la modificación de la imagen de la pantalla LockScreen
REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows\Personalization" /V "NoChangingLockScreen" /F >NUL 2>&1

Echo [+] Desactivar Aero Peek
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /V "DisablePreviewDesktop" /T "REG_DWORD" /D "1" /F >NUL 2>&1

Echo [+] Renombrar la carpeta "Equipo"
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" /V  "" /D "ElektroStudios" /F >NUL 2>&1

Echo [+] Añadir ".:: Modo Dios ::." al panel de control
REG ADD "HKLM\SOFTWARE\Classes\CLSID\{D15ED2E1-C75B-443c-BD7C-FC03B2F08C17}" /V  "" /D ".: Modo Dios :." /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Classes\CLSID\{D15ED2E1-C75B-443c-BD7C-FC03B2F08C17}" /V "InfoTip" /T "REG_SZ" /D "Todo lo que Dios puede hacer..." /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Classes\CLSID\{D15ED2E1-C75B-443c-BD7C-FC03B2F08C17}" /V "System.ControlPanel.Category" /T "REG_SZ" /D "5" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Classes\CLSID\{D15ED2E1-C75B-443c-BD7C-FC03B2F08C17}\DefaultIcon" /V  "" /D "%%SystemRoot%%\\System32\\imageres.dll,-27" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Classes\CLSID\{D15ED2E1-C75B-443c-BD7C-FC03B2F08C17}\Shell\Open\Command" /V  "" /D "explorer.exe shell:::{ED7BA470-8E54-465E-825C-99712043E01C}" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\{D15ED2E1-C75B-443c-BD7C-FC03B2F08C17}" /V  "" /D ".: Modo Dios :." /F >NUL 2>&1

Echo [+] Mostrar la letra de la unidad a la izquierda
for /F "delims= " %%a in ('"wmic useraccount where name='%UserName%' get sid" ^| MORE +1') do (
reg add "HKEY_USERS\%%a\Software\Microsoft\Windows\CurrentVersion\Explorer" /v "ShowDriveLettersFirst" /T "REG_DWORD" /D "4" /F >NUL 2>&1
)

Echo [+] Restaurar las carpetas abiertas al reiniciar Windows
for /F "delims= " %%a in ('"wmic useraccount where name='%UserName%' get sid" ^| MORE +1') do (
REG ADD "HKEY_USERS\%%a\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "PersistBrowsers" /T "REG_DWORD" /D "1" /F >NUL 2>&1
)
Echo [+] Tamaño de la vista del panel de control
REG ADD "HKEY_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\StartupPage" /V "StartupPage" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /V "AllItemsIconView" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1

Echo [+] Mostrar conflictos de combinacion de carpeta
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /V "HideMergeConflicts" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1

REM Echo [+] Mostrar extension de archivos .lnk
REM REG DELETE "HKEY_CLASSES_ROOT\lnkfile" /V "NeverShowExt" /F >NUL 2>&1

Echo [+] Mostrar extension de archivos .url
REG DELETE "HKEY_CLASSES_ROOT\InternetShortcut" /V "NeverShowExt" /F >NUL 2>&1

Echo [+] Mostrar extension de archivos .pif
REG DELETE "HKEY_CLASSES_ROOT\piffile" /V "NeverShowExt" /F >NUL 2>&1

Echo [+] Mostrar extension de archivos .SHC
REG DELETE "HKEY_CLASSES_ROOT\SHCmdFile" /V "NeverShowExt" /F >NUL 2>&1

Echo [+] Mostrar extension de archivos .xnk
REG DELETE "HKEY_CLASSES_ROOT\xnkfile" /V "NeverShowExt" /F >NUL 2>&1

Echo+
Echo :: ###############
Echo :: Menu contextual
Echo :: ###############
Echo+

Echo [+] Eliminar opcion: Nuevo ^> BMP
REG DELETE "HKCR\.bmp\ShellNew" /V "Nullfile" /F >NUL 2>&1

Echo [+] Eliminar opcion: Nuevo ^> Contacto
REG DELETE "HKCR\.contact\ShellNew" /F >NUL 2>&1

Echo [+] Eliminar opcion: Nuevo ^> Documento de Windows journal
REG DELETE "HKCR\.jnt\jntfile\ShellNew" /F >NUL 2>&1

Echo [+] Eliminar opcion: Nuevo ^> ATL MFC Trace Tool settings file
REG DELETE "HKCR\.trc\ShellNew" /V "Nullfile" /F >NUL 2>&1

Echo [+] Eliminar opcion: Nuevo ^> Zip
REG DELETE "HKCR\.zip\ShellNew" /F >NUL 2>&1

Echo [+] Desactivar límite de 15 archivos
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /V "MultipleInvokePromptMinimum" /T "REG_DWORD" /D "0x00002710" /F 1>NUL

Echo [+] Añadir opcion: Desempaquetar MSI
REG ADD "HKCR\Msi.Package\shell\Desempaquetar MSI" /V "icon" /T "REG_SZ" /D "msiexec.exe" /F 1>NUL
REG ADD "HKCR\Msi.Package\shell\Desempaquetar MSI" /V "position" /T "REG_SZ" /D "top" /F 1>NUL
REG ADD "HKCR\Msi.Package\shell\Desempaquetar MSI\command" /V  "" /D "msiexec.exe /a \"%%1\" /qb TARGETDIR=\"%%1 Contents\"" /F 1>NUL

Echo [+] Añadir opcion: Seleccionar
REG ADD "HKCR\*\shell\Seleccionar" /V "MUIVerb" /T "REG_SZ" /D "Seleccionar" /F >NUL 2>&1
REG ADD "HKCR\*\shell\Seleccionar" /V "icon" /T "REG_SZ" /D "imageres.dll,-5308" /F >NUL 2>&1
REG ADD "HKCR\*\shell\Seleccionar" /V "position" /T "REG_SZ" /D "middle" /F >NUL 2>&1
REG ADD "HKCR\*\shell\Seleccionar" /V "SubCommands" /T "REG_SZ" /D "Windows.selectall;Windows.selectnone;Windows.invertselection" /F >NUL 2>&1

REG ADD "HKCR\Folder\shell\Seleccionar" /V "MUIVerb" /T "REG_SZ" /D "Seleccionar" /F >NUL 2>&1
REG ADD "HKCR\Folder\shell\Seleccionar" /V "position" /T "REG_SZ" /D "middle" /F >NUL 2>&1
REG ADD "HKCR\Folder\shell\Seleccionar" /V "icon" /T "REG_SZ" /D "imageres.dll,-5308" /F >NUL 2>&1
REG ADD "HKCR\Folder\shell\Seleccionar" /V "SubCommands" /T "REG_SZ" /D "Windows.selectall;Windows.selectnone;Windows.invertselection" /F >NUL 2>&1

REG ADD "HKCR\Directory\Background\shell\Seleccionar" /V "MUIVerb" /T "REG_SZ" /D "Seleccionar" /F >NUL 2>&1
REG ADD "HKCR\Directory\Background\shell\Seleccionar" /V "position" /T "REG_SZ" /D "middle" /F >NUL 2>&1
REG ADD "HKCR\Directory\Background\shell\Seleccionar" /V "icon" /T "REG_SZ" /D "imageres.dll,-5308" /F >NUL 2>&1
REG ADD "HKCR\Directory\Background\shell\Seleccionar" /V "SubCommands" /T "REG_SZ" /D "Windows.selectall" /F >NUL 2>&1

REG ADD "HKCR\LibraryFolder\Background\shell\Seleccionar" /V "MUIVerb" /T "REG_SZ" /D "Seleccionar" /F >NUL 2>&1
REG ADD "HKCR\LibraryFolder\Background\shell\Seleccionar" /V "position" /T "REG_SZ" /D "middle" /F >NUL 2>&1
REG ADD "HKCR\LibraryFolder\Background\shell\Seleccionar" /V "icon" /T "REG_SZ" /D "imageres.dll,-5308" /F >NUL 2>&1
REG ADD "HKCR\LibraryFolder\Background\shell\Seleccionar" /V "SubCommands" /T "REG_SZ" /D "Windows.selectall;Windows.selectnone;Windows.invertselection" /F >NUL 2>&1

Echo [+] Menu contextual - Cambiar icono de la opcion "Editar"
REG ADD "HKCR\SystemFileAssociations\image\shell\edit" /V "icon" /T "REG_SZ" /D "mspaint.exe" /F >NUL 2>&1
REG ADD "HKCR\SystemFileAssociations\text\shell\edit" /V "icon" /T "REG_SZ" /D "notepad.exe" /F >NUL 2>&1
REG ADD "HKCR\batfile\shell\edit" /V "icon" /T "REG_SZ" /D "notepad.exe" /F >NUL 2>&1
REG ADD "HKCR\cmdfile\shell\edit" /V "icon" /T "REG_SZ" /D "notepad.exe" /F >NUL 2>&1
REG ADD "HKCR\regfile\shell\edit" /V "icon" /T "REG_SZ" /D "notepad.exe" /F >NUL 2>&1
REG ADD "HKCR\vbsFile\Shell\Edit" /V "icon" /T "REG_SZ" /D "notepad.exe" /F >NUL 2>&1

Echo [+] Menu contextual - Eliminar opcion "Anclar al inicio"
REG DELETE "HKCR\Folder\shell\pintostartscreen" /F  >NUL 2>&1

Echo [+] Añadir cascada de opciones: Accesorios de Windows
REG ADD "HKCR\DesktopBackground\Shell\Accesorios" /V "MUIVerb" /T "REG_SZ" /D "Accesorios de Windows" /F >NUL 2>&1
REG ADD "HKCR\DesktopBackground\Shell\Accesorios" /V "SubCommands" /T "REG_SZ" /D "Bloc.de.notas;Calculadora;Grabadora.de.sonidos;Grabacion.de.acciones;Lupa;Mapa.de.caracteres;Notas;Paint;Programador.de.tareas;Recortes;Teclado.virtual" /F >NUL 2>&1
REG ADD "HKCR\DesktopBackground\Shell\Accesorios" /V "icon" /T "REG_SZ" /D "imageres.dll,-109" /F >NUL 2>&1
REG ADD "HKCR\DesktopBackground\Shell\Accesorios" /V "position" /T "REG_SZ" /D "Bottom" /F >NUL 2>&1

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Bloc.de.notas" /V  "" /D "Bloc de notas" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Bloc.de.notas" /V "icon" /T "REG_SZ" /D "notepad.exe" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Bloc.de.notas\command" /V  "" /D "notepad.exe" /F >NUL 2>&1

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Calculadora" /V  "" /D "Calculadora" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Calculadora" /V "icon" /T "REG_SZ" /D "calc.exe" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Calculadora\command" /V  "" /D "calc.exe" /F >NUL 2>&1

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Grabadora.de.sonidos" /V  "" /D "Grabadora de sonidos" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Grabadora.de.sonidos" /V "icon" /T "REG_SZ" /D "SoundRecorder.exe" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Grabadora.de.sonidos\command" /V  "" /D "SoundRecorder.exe" /F >NUL 2>&1

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Grabacion.de.acciones" /V  "" /D "Grabación de acciones" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Grabacion.de.acciones" /V "icon" /T "REG_SZ" /D "psr.exe" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Grabacion.de.acciones\command" /V  "" /D "psr.exe" /F >NUL 2>&1

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Lupa" /V  "" /D "Lupa" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Lupa" /V "icon" /T "REG_SZ" /D "magnify.exe" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Lupa\command" /V  "" /D "magnify.exe" /F >NUL 2>&1

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Mapa.de.caracteres" /V  "" /D "Mapa de caracteres" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Mapa.de.caracteres" /V "icon" /T "REG_SZ" /D "charmap.exe" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Mapa.de.caracteres\command" /V  "" /D "charmap.exe" /F >NUL 2>&1

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Notas" /V  "" /D "Notas" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Notas" /V "icon" /T "REG_SZ" /D "StikyNot.exe" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Notas\command" /V  "" /D "StikyNot.exe" /F >NUL 2>&1

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Paint" /V  "" /D "Paint" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Paint" /V "icon" /T "REG_SZ" /D "mspaint.exe" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Paint\command" /V  "" /D "mspaint.exe" /F >NUL 2>&1

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Programador.de.tareas" /V  "" /D "Programador de tareas" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Programador.de.tareas" /V "icon" /T "REG_SZ" /D "miguiresource.dll,1" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Programador.de.tareas\command" /V  "" /D "Control schedtasks" /F >NUL 2>&1

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Recortes" /V  "" /D "Recortes" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Recortes" /V "icon" /T "REG_SZ" /D "SnippingTool.exe" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Recortes\command" /V  "" /D "SnippingTool.exe" /F >NUL 2>&1

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Teclado.virtual" /V  "" /D "Teclado virtual" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Teclado.virtual" /V "icon" /T "REG_SZ" /D "osk.exe" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Teclado.virtual\command" /V  "" /D "osk.exe" /F >NUL 2>&1

Echo [+] Añadir cascada de opciones: Plan de Energia
REG ADD "HKCR\DesktopBackground\Shell\PowerPlan" /V "MUIVerb" /T "REG_SZ" /D "Plan de Energía" /F >NUL 2>&1
REG ADD "HKCR\DesktopBackground\Shell\PowerPlan" /V "SubCommands" /T "REG_SZ" /D "PowerPlan.Equilibrado;PowerPlan.Economizador;PowerPlan.Alto.Rendimiento" /F >NUL 2>&1
REG ADD "HKCR\DesktopBackground\Shell\PowerPlan" /V "Icon" /T "REG_SZ" /D "powercpl.dll" /F >NUL 2>&1
REG ADD "HKCR\DesktopBackground\Shell\PowerPlan" /V "Position" /T "REG_SZ" /D "Bottom" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\PowerPlan.Alto.Rendimiento" /V  "" /D "Alto Rendimiento" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\PowerPlan.Alto.Rendimiento" /V "Icon" /T "REG_SZ" /D "powercpl.dll" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\PowerPlan.Alto.Rendimiento\command" /V  "" /D "powercfg.exe /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\PowerPlan.Equilibrado" /V  "" /D "Equilibrado" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\PowerPlan.Equilibrado" /V "Icon" /T "REG_SZ" /D "powercpl.dll" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\PowerPlan.Equilibrado\command" /V  "" /D "powercfg.exe /setactive 381b4222-f694-41f0-9685-ff5bb260df2e" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\PowerPlan.Economizador" /V  "" /D "Economizador" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\PowerPlan.Economizador" /V "Icon" /T "REG_SZ" /D "powercpl.dll" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\PowerPlan.Economizador\command" /V  "" /D "powercfg.exe /setactive a1841308-3541-4fab-bc81-f71556f20b4a" /F >NUL 2>&1

Echo+
Echo :: ########
Echo :: Hardware
Echo :: ########
Echo+

Echo [+] Aumentar la sensibilidad del Raton
REG ADD "HKCU\Control Panel\Mouse" /V "MouseSensitivity" /T "REG_SZ" /D "16" /F >NUL 2>&1

Echo [+] Desactivar el Sistema de cifrado de archivos EFS
fsutil behavior set disableencryption 1 >NUL 2>&1

Echo [+] Desactivar la creación automática de nombres cortos
fsutil behavior set Disable8dot3 1 >NUL 2>&1
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /V "NtfsDisable8dot3NameCreation" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Desactivar la marca de último acceso de archivos
fsutil behavior set DisableLastAccess 1 >NUL 2>&1
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /V "ntfsdisablelastaccessupdate" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Desactivar la encriptacion EFS de archivos
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /V "NtfsDisableEncryption" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Deshabilitar la desfragmentación de inicio
REG ADD "HKLM\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction" /V "Enable" /T "REG_SZ" /D "N" /F >NUL 2>&1

Echo [+] Velocidad del cursor del teclado
REG ADD "HKCU\Control Panel\Desktop" /V "CursorBlinkRate" /T "REG_SZ" /D "200" /F >NUL 2>&1

Echo [+] GPU Hang TimeOut
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" /V "TdrDelay" /T "REG_DWORD" /D "0x0000000a" /F >NUL 2>&1

Echo [+] No limpiar la memória virtual al apagar el sistema
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /V "ClearPageFileAtShutdown" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1

Echo+
Echo :: #####
Echo :: REDES
Echo :: #####
Echo+

Echo [+] Desactivar la compartición automatica de redes
REG ADD "HKLM\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters" /V "AutoShareWks" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1
REG ADD "HKLM\SYSTEM\ControlSet001\services\LanmanServer\Parameters" /V "AutoShareWks" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1
REG ADD "HKLM\SYSTEM\ControlSet002\services\LanmanServer\Parameters" /V "AutoShareWks" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1

Echo [+] Establecer las nuevas redes encontradas como "Publicas"
REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\010103000F0000F0010000000F0000F0C967A3643C3AD745950DA7859209176EF5B87C875FA20DF21951640E807D7C24" /V "Category" /T "REG_DWORD" /D "0x00000000"  /F >NUL 2>&1

Echo [+] Deshabilitar Cliente para redes Microsoft
netcfg /u ms_msclient >NUL 2>&1

Echo [+] Deshabilitar Controlador de E/S del asignador de deteccion de topologias
netcfg /u ms_lltdio >NUL 2>&1

Echo [+] Deshabilitar Compartir impresoras y archivos para redes Microft
netcfg /u ms_server >NUL 2>&1

Echo [+] Deshabilitar Filtro ligero de captura de NDIS
netcfg /u ms_ndiscap >NUL 2>&1

Echo [+] Deshabilitar NetBios Interface
netcfg /u ms_netbios >NUL 2>&1

Echo [+] Deshabilitar NetBios SMB
netcfg /u ms_smb >NUL 2>&1

Echo [+] Deshabilitar Programador de paquetes QoS
netcfg /u ms_pacer >NUL 2>&1

Echo [+] Deshabilitar Protocolo de Internet version 6 (TCPIP v6)
netcfg /u ms_tcpip6 >NUL 2>&1

Echo [+] Deshabilitar Respondedor de deteccion de topologias de nivel de vinculo
netcfg /u ms_rspndr >NUL 2>&1

Echo [+] Deshabilitar WFP Lightweight Filter
netcfg /u ms_wfplwf >NUL 2>&1

Echo [+] Deshabilitar la reserva de ancho de banda de QoS
REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\PSched" /V "NonBestEffortLimit" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1

rem Echo [+] Usar las DNS de Google
rem For /F "Tokens=*" %%# in ('Reg query "HKLM\SYSTEM\ControlSet001\services\Tcpip\Parameters\Interfaces"') do (
rem Reg ADD "%%#" /V "NameServer" /D "8.8.8.8,8.8.4.4" /F >NUL 2>&1
rem )

Echo+
Echo :: #######
Echo :: Sistema
Echo :: #######
Echo+

Echo [+] Eliminar opción: "Buscar otra aplicacion en la Tienda de Windows"
REG ADD "HKCU\Software\Policies\Microsoft\Windows\Explorer" /V "NoUseStoreOpenWith" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1
REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /V "NoUseStoreOpenWith" /F >NUL 2>&1

Echo [+] Cantidad de scrolls de pagina al mover la rueda del raton
REG ADD "HKCU\Control Panel\Desktop" /V "WheelScrollChars" /T "REG_SZ" /D "10" /F >NUL 2>&1
REG ADD "HKCU\Control Panel\Desktop" /V "WheelScrollLines" /T "REG_SZ" /D "10" /F >NUL 2>&1

Echo [+] Capacidad de la papelera de reciclaje
for /F "tokens=*" %%a in ('Reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume"') do (
reg add "%%a" /v "MaxCapacity" /T "REG_DWORD" /D "999999" /F >NUL 2>&1
)

Echo [+] Configuracion predeterminada del salvapantallas de texto
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "AllScreensSame" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "SurfaceType" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "Specular" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "SurfaceColor" /T "REG_DWORD" /D "0x00777777" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "CustomTexture" /T "REG_SZ" /D "" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "CustomEnvironment" /T "REG_SZ" /D "" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "UseCustomColor" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "UseCustomTexture" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "UseCustomEnvironment" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "MeshQuality" /T "REG_DWORD" /D "0x00000320" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "Size" /T "REG_DWORD" /D "0x0000000a" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "RotationSpeed" /T "REG_DWORD" /D "0x00000008" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "RotationStyle" /T "REG_DWORD" /D "0x00000003" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "DisplayString" /T "REG_SZ" /D "Elektro Studios" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "DisplayTime" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "FontWeight" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "FontHeight" /T "REG_DWORD" /D "0x00000060" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "FontItalic" /T "REG_DWORD" /D "0x01000000" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "FontCharSet" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "FontPitchFamily" /T "REG_DWORD" /D "0x61005400" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Screensavers\ssText3d" /V "FontFace" /T "REG_SZ" /D "Tahoma" /F >NUL 2>&1
REG ADD "HKCU\Control Panel\Desktop" /V "SCRNSAVE.EXE" /T "REG_SZ" /D "%windir%\system32\ssText3d.scr" /F >NUL 2>&1

Echo [+] Desactivar aviso de poco espacio en disco duro
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /V "NoLowDiskSpaceChecks" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Desactivar aviso de seguridad al abrir archivos
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments" /V "SaveZoneInformation" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Associations" /V "LowRiskFileTypes" /T "REG_SZ" /D ".avi;.bat;.com;.cmd;.exe;.htm;.html;.mpg;.mpeg;.mov;.mp3;.msi;.m3u;.rar;.reg;.txt;.vbs;.wav;.zip;.url;" /F >NUL 2>&1
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments" /V "SaveZoneInformation" /F >NUL 2>&1
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Associations" /V "LowRiskFileTypes" /F >NUL 2>&1

Echo [+] Desactivar la organizacion de la ventana al moverla al borde de la pantalla
REG ADD "HKCU\Control Panel\Desktop" /V "WindowArrangementActive" /T "REG_SZ" /D "0" /F >NUL 2>&1

Echo [+] Desactivar UAC
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /V "ConsentPromptBehaviorAdmin" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /V "EnableLUA" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1

Echo [+] Desactivar Windows Flip3D
for /F "delims= " %%a in ('"wmic useraccount where name='%UserName%' get sid" ^| MORE +1') do (
reg add "HKEY_USERS\%%a\Software\Policies\Microsoft\Windows\DWM" /v "DisallowFlip3D" /T "REG_DWORD" /D "1" /F >NUL 2>&1
)

Echo [+] Deshabilitar Cliente de impresion en internet
dism /online /disable-feature /featurename:"TFTP" /quiet /norestart >NUL 2>&1

Echo [+] Deshabilitar Cliente TFTP
dism /online /disable-feature /featurename:"Printing-Foundation-InternetPrinting-Client" /quiet /norestart >NUL 2>&1

Echo [+] Deshabilitar Fax y escaner de Windows
dism /online /disable-feature /featurename:"FaxServicesClientPackage" /quiet /norestart >NUL 2>&1

Echo [+] Deshabilitar Internet Explorer
dism /online /disable-feature /featurename:"Internet-Explorer-Optional-amd64" /quiet /norestart >NUL 2>&1

Echo [+] Deshabilitar Juegos de Windows
dism /online /disable-feature /featurename:"InboxGames" /quiet /norestart >NUL 2>&1
dism /online /disable-feature /featurename:"More Games" /quiet /norestart >NUL 2>&1
dism /online /disable-feature /featurename:"Internet Games" /quiet /norestart >NUL 2>&1

Echo [+] Deshabilitar Monitor de puerto de LPR
dism /online /disable-feature /featurename:"Printing-Foundation-LPRPortMonitor" /quiet /norestart >NUL 2>&1

Echo [+] Deshabilitar Servicios XPS
dism /online /disable-feature /featurename:"Printing-XPSServices-Features" /quiet /norestart >NUL 2>&1

Echo [+] Deshabilitar Tablet PC
dism /online /disable-feature /featurename:"TabletPCOC" /quiet /norestart >NUL 2>&1

Echo [+] Deshabilitar Visor de XPS
dism /online /disable-feature /featurename:"Xps-Foundation-Xps-Viewer" /quiet /norestart >NUL 2>&1

Echo [+] Deshabilitar Windows media center
dism /online /disable-feature /featurename:"MediaCenter" /quiet /norestart >NUL 2>&1

Echo [+] Deshabilitar Windows media playback
dism /online /disable-feature /featurename:"MediaPlayback" /quiet /norestart >NUL 2>&1

Echo [+] Deshabilitar Windows media player
dism /online /disable-feature /featurename:"WindowsMediaPlayer" /quiet /norestart >NUL 2>&1

Echo [+] Deshabilitar Power Shell
dism /online /disable-feature /featurename:"MicrosoftWindowsPowerShellV2" /quiet /norestart >NUL 2>&1
dism /online /disable-feature /featurename:"MicrosoftWindowsPowerShellV2Root" /quiet /norestart >NUL 2>&1

Echo [+] Deshabilitar la opción "Añadir características"
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\WAU" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\WAU" /V "Disabled" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\WAU" /F >NUL 2>&1
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\WAU" /V "Disabled" /F >NUL 2>&1

Echo [+] Eliminar el sufijo "ACCESO DIRECTO" de los accesos directos
Reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer" /v "link" /T "REG_BINARY" /D "00 00 00" /F >NUL 2>&1
Reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /v "link" /T "REG_BINARY" /D "00 00 00" /F >NUL 2>&1

Echo [+] Mostrar el puntero del raton al presionar la tecla "control"
REG ADD "HKCU\Control Panel\Desktop" /V "UserPreferencesMask" /T "REG_BINARY" /D "9e5e068012000000" /F >NUL 2>&1

Echo [+] Ocultar la Papelera de reciclaje del escritorio
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /V "{645FF040-5081-101B-9F08-00AA002F954E}" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /V "{645FF040-5081-101B-9F08-00AA002F954E}" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Tamaño de las miniaturas de las vistas previas de la barra de tareas
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /V "MaxThumbSizePx" /T "REG_DWORD" /D "0x00000190" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /V "MinThumbSizePx" /T "REG_DWORD" /D "0x000000c8" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /V "ThumbSpacingXPx" /T "REG_DWORD" /D "0x00000005" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /V "ThumbSpacingYPx" /T "REG_DWORD" /D "0x00000005" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /V "TopMarginPx" /T "REG_DWORD" /D "0x00000005" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /V "BottomMarginPx" /T "REG_DWORD" /D "0x00000005" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /V "LeftMarginPx" /T "REG_DWORD" /D "0x00000005" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /V "RightMarginPx" /T "REG_DWORD" /D "0x00000005" /F >NUL 2>&1

Echo [+] Activar Word-Wrap en Notepad
REG ADD "HKCU\Software\Microsoft\Notepad" /V "fWrap" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Mostrar confirmacion al enviar archivos a la papelera de reciclaje
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /V "ConfirmFileDelete" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /V "ConfirmFileDelete" /F >NUL 2>&1

Echo [+] Ir directamente al escritorio en Windows 8
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StartPage" /V "OpenAtLogon" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Deshabilitar la hibernacion
powercfg -h off

Echo [+] Acelerar el apagado de Windows
REG ADD "HKCU\Control Panel\desktop" /V "AutoEndTasks" /T "REG_SZ" /D "1" /F >NUL 2>&1
REG ADD "HKCU\Control Panel\desktop" /V "HungAppTimeout" /T "REG_SZ" /D "2000" /F >NUL 2>&1
REG ADD "HKCU\Control Panel\desktop" /V "WaitToKillAppTimeout" /T "REG_SZ" /D "5000" /F >NUL 2>&1
REG ADD "HKCU\Control Panel\desktop" /V "WaitToKillServiceTimeout" /T "REG_SZ" /D "2000" /F >NUL 2>&1
REG ADD "HKCU\Control Panel\desktop" /V "PowerOffActive" /T "REG_SZ" /D "1" /F >NUL 2>&1
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control" /V "WaitToKillServiceTimeout" /T "REG_SZ" /D "2000" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /V "PowerdownAfterShutdown" /T "REG_SZ" /D "1" /F >NUL 2>&1
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /V "ShutdownWithoutLogon" /T "REG_SZ" /D "1" /F >NUL 2>&1

Echo [+] Aumentar Cache de prelectura
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /V "Max Cached Icons" /T "REG_SZ" /D "4096" /F >NUL 2>&1
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /V "ReadAheadThresold" /T "REG_BINARY" /D "0000000f" /F >NUL 2>&1
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /V "NameCache" /T "REG_BINARY" /D "00ff0000" /F >NUL 2>&1
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /V "PathCache" /T "REG_BINARY" /D "ff000000" /F >NUL 2>&1

Echo [+] Desactivar envio de informe de errores a Microsoft
REG ADD "HKCU\Software\Microsoft\Windows\Windows Error Reporting" /V "Disabled" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Desactivar la creacion del log si hay un error en el sistema
REG ADD "HKLM\system\ControlSet001\Control\CrashContro" /V "LogEvent" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1

Echo [+] Desactivar la verificación de drivers no firmados
bcdedit.exe -set loadoptions ENABLE_INTEGRITY_CHECKS  >NUL 2>&1
bcdedit.exe -set TESTSIGNING OFF >NUL 2>&1

Echo [+] Deshabilitar los contadores de rendimiento
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib" /V "Disable Performance Counters" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Deshabilitar SuperFecth
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" /V "EnableSuperfetch" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" /V "EnablePrefetcher" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1
REG ADD "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Memory Management\PrefetchParameters" /V "EnableSuperfetch" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1
REG ADD "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Memory Management\PrefetchParameters" /V "EnablePrefetcher" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1
REG ADD "HKLM\SYSTEM\ControlSet002\Control\Session Manager\Memory Management\PrefetchParameters" /V "EnableSuperfetch" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1
REG ADD "HKLM\SYSTEM\ControlSet002\Control\Session Manager\Memory Management\PrefetchParameters" /V "EnablePrefetcher" /T "REG_DWORD" /D "0x00000000" /F >NUL 2>&1

Echo [+] Forzar la descarga de las DLL al salir de la aplicacion
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /V "AlwaysUnloadDLL" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Desactivar local Distributed File System
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /V "NoDFSTab”" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1

Echo [+] Desactivar AutoPlay
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /V "NoDriveTypeAutoRun”" /T "REG_DWORD" /D "0x00000001" /F >NUL 2>&1
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" /V "DisableAutoplay" /T "REG_DWORD" /D "0x00000001" /F  >NUL 2>&1

Echo [+] Añadir variable de entorno "Downloads"
SETX Downloads "%Userprofile%\Downloads" >NUL 2>&1

Echo [+] Desactivar el contador del tiempo de bloqueo de cuenta de usuario
net accounts /lockoutwindow:0 >NUL 2>&1

Echo [+] Desactivar la duración de bloqueo de cuenta de usuario
net accounts /lockoutduration:0 >NUL 2>&1

Echo [+] Desactivar el contador de intentos inválidos de acceso de cuenta de usuario
net accounts /lockoutthreshold:999 >NUL 2>&1

Echo [+] Modificar el tiempo de espera de la lista de OS del Boot Loader
bcdedit /timeout 5 >NUL 2>&1

Echo [+] Desactivar la animación GUI del Boot
bcdedit /set {current} quietboot Yes >NUL 2>&1






Echo [+] Añadir opciones para bootear en Modo Seguro

SetLocal EnableDelayedExpansion

::: Customize your safe mode names here:
:::
Set "SafeMode_Description=Windows 8 Modo Seguro"
Set "SafeModeNetrowk_Description=Windows 8 Modo Seguro con funciones de Red"
Set "SafeModeShell_Description=Windows 8 Modo Seguro con Consola"
:::

(
Bcdedit /Enum /V | FINDSTR /I "^Descrip" | FIND /I "%SafeMode_Description%" 1>NUL
) || (
Bcdedit /Copy {current} /D "%SafeMode_Description%" 1>NUL
)

(
Bcdedit /Enum /V | FINDSTR /I "^Descrip" | FIND /I "%SafeModeNetrowk_Description%" 1>NUL
) || (
Bcdedit /Copy {current} /D "%SafeModeNetrowk_Description%" 1>NUL
)

(
Bcdedit /Enum /V | FINDSTR /I "^Descrip" | FIND /I "%SafeModeShell_Description%" 1>NUL
) || (
Bcdedit /Copy {current} /D "%SafeModeShell_Description%" 1>NUL
)

For /F "Tokens=2" %%# in (
'Bcdedit /Enum /V ^| FINDSTR /I "^Identif"'
) do (
SET /A ID_INDEX+=1
Set "ID!ID_INDEX!=%%#"
)

For /F "Tokens=1,*" %%A in (
'Bcdedit /Enum /V ^| FINDSTR /I "^Descrip"'
) do (
SET /A DES_INDEX+=1
Set "DES!DES_INDEX!=%%B"
)

For /L %%X in (1, 1, %ID_INDEX%) do (

If /I "!DES%%X!" EQU "%SafeMode_Description%" (
Bcdedit /Set "!ID%%X!" safeboot Minimal 1>NUL
Bcdedit /Set "!ID%%X!" quietboot Yes    1>NUL
)

If /I "!DES%%X!" EQU "%SafeModeNetrowk_Description%" (
Bcdedit /Set "!ID%%X!" safeboot Network 1>NUL
Bcdedit /Set "!ID%%X!" quietboot Yes    1>NUL
)

If /I "!DES%%X!" EQU "%SafeModeShell_Description%" (
Bcdedit /Set "!ID%%X!" safeboot Minimal           1>NUL
Bcdedit /Set "!ID%%X!" safebootalternateshell Yes 1>NUL
Bcdedit /Set "!ID%%X!" quietboot Yes              1>NUL
)

)

SetLocal DisableDelayedExpansion

TIMEOUT /T 3
Exit
8095  Programación / .NET (C#, VB.NET, ASP) / Re: [SOURCE] mrtzcmp3 Downloader en: 26 Octubre 2013, 16:29 pm
La solución propuesta es fácilmente mejorable, muestro dos ejemplos.

Versión RegEx:
Código
  1. #Region " URL Decode "
  2.  
  3.    ' [ URL Decode ]
  4.    '
  5.    ' //By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    ' MsgBox(URL_Decode("http%3A%2F%2Fwww%2Ewebsite%2Ecom%2Fpage%2Easp%3Fid%3D5%26test%3DHello%5FWorld"))
  9.    ' Result: http://www.website.com/page.asp?id=5&test=Hello_World
  10.  
  11.    Private Function URL_Decode(ByVal url As String) As String
  12.  
  13.        Return Regex.Replace( _
  14.                     url.Replace("+", Chr(Keys.Space)), _
  15.                     "(%[\dA-F]{2})", Function(hex) Chr(String.Format("&H{0}", hex.Value.Substring(1))), _
  16.                     RegexOptions.IgnoreCase)
  17.  
  18.    End Function
  19.  
  20. #End Region


Versión Select Case:
Código
  1. #Region " URL Decode "
  2.  
  3.    ' [ URL Decode ]
  4.    '
  5.    ' //By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    ' MsgBox(URL_Decode("http%3A%2F%2Fwww%2Ewebsite%2Ecom%2Fpage%2Easp%3Fid%3D5%26test%3DHello%5FWorld"))
  9.    ' Result: http://www.website.com/page.asp?id=5&test=Hello_World
  10.  
  11.    Private Function URL_Decode(ByVal url As String) As String
  12.  
  13.        Dim decoded As String = String.Empty
  14.  
  15.        For c As Integer = 0 To (url.Length - 1)
  16.            Select Case url(c)
  17.                Case "+"
  18.                    decoded &= Convert.ToChar(Keys.Space)
  19.                Case "%"
  20.                    decoded &= Convert.ToChar(CInt("&H" & url(c + 1) & url(c + 2)))
  21.                    c += 2
  22.                Case Else
  23.                    decoded &= url(c)
  24.            End Select
  25.        Next c
  26.  
  27.        Return decoded
  28.  
  29.    End Function
  30.  
  31. #End Region

También se puede mejorar todo lo demás del proyecto en general para desarrollar un downloader asincronico, pero con este código es más que suficiente.

Esto lo posteo para todas aquellas personas que se encuentren en la misma situación,
sincéramente, no lo posteo para ayudar al autor del post, ni al otro usuario.

Un saludo!
8096  Foros Generales / Sugerencias y dudas sobre el Foro / Re: Estrasburgo avala que se culpe a un medio 'online' por los comentarios ofensivos en: 26 Octubre 2013, 12:52 pm
que los medios 'online' se tengan que responsabilizar de los comentarios ofensivos publicados por sus lectores

El mundo se ha vuelto loco, y para colmo lo avala un "tribunal de derechos humanos", que con ese nombre se supone que debería ser un grupo de personas con dos ***** dedos de conocimiento para comprender que una persona no se puede responsabilizar de los actos de otra tercera persona.

Es como si un loco ve un coche que no le gusta en un concesionario y decide poner una bomba en el coche, claro, según este "tribunal de derechos humanos", con mucha lógica, la culpa y la condena carcelaria sería para el encargado del concesionario, por poner el coche ahi para que otras personas puedan verlo, olerlo, tocarlo, y opinar sobre él... en fín, mundo de hipocritas y descerebrados.

Saludos!
8097  Sistemas Operativos / Windows / Re: como editar mi sistema operativo windows ! en: 26 Octubre 2013, 09:02 am
Mi inquietud era si hay manera de poder cambiar la información del sistema (os)
no porque quiero estafar a alguien simplemente por ser un curioso, me gusta ver como funciona el os demi pc explorar curiosear.

Editar el valor de unas claves de registro con intención de falsear información de un par de etiquetas OEM del panel de control no te puede ayudar a aprender como funciona un sistema operativo... es una completa estupidez.
Si quieres aprender algo útil, entonces coje un manual del Regedit o del funcionamiento de Windows y empieza a leer.

Un saludo!
8098  Foros Generales / Foro Libre / Re: internet en la luna en: 25 Octubre 2013, 17:28 pm
Citar
La Luna ya tiene Internet

Y a todo esto, ¿para que narices quieren establecer Internet en la Luna?, ¿Quizás para hacer streamings en directo de partidos de fútbol con pelotas de roca Lunar?...

Ya me lo veo venir en un futuro no muy lejano (o quizás si, muy lejano)... el Moonball señores!

Un saludo!
8099  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets) en: 25 Octubre 2013, 17:14 pm
Una función genérica para agregar un item a un array de 2 dimensiones

Código
  1. #Region " Add Item Array 2D "
  2.  
  3.    ' [ Add Item Array 2D ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Examples :
  8.    '
  9.    '// Create an Array 2D (2,2)
  10.    ' Dim MyArray As String(,) = {{"Item 0,0", "Item 0,1"}, {"Item 1,0", "Item 1,1"}, {"Item 2,0", "Item 2,1"}}
  11.    '// Add an Item
  12.    ' Add_Item_Array_2D(MyArray, {"Item 3,0", "Item 3,1"})
  13.  
  14.    Private Sub Add_Item_Array_2D(ByRef Array_2D As String(,), _
  15.                                  ByVal Items As String())
  16.  
  17.        Dim tmp_array(Array_2D.GetUpperBound(0) + 1, Array_2D.GetUpperBound(1)) As String
  18.  
  19.        For x As Integer = 0 To Array_2D.GetUpperBound(0)
  20.            tmp_array(x, 0) = Array_2D(x, 0)
  21.            tmp_array(x, 1) = Array_2D(x, 1)
  22.        Next
  23.  
  24.        For x As Integer = 0 To Items.Count - 1
  25.            tmp_array(tmp_array.GetUpperBound(0), x) = Items(x)
  26.        Next
  27.  
  28.        Array_2D = tmp_array
  29.  
  30.    End Sub
  31.  
  32. #End Region





Un ejemplo de como ordenar un documento XML según un elemento dado:

Código
  1. #Region " Sort XML By Element "
  2.  
  3.    ' [ Sort XML By Element ]
  4.    '
  5.    ' // By Elektro H@cker
  6.    '
  7.    ' Example usage :
  8.    ' Dim XML As XDocument = Sort_XML_By_Element(XDocument.Load("C:\File.xml"), "Song", "Name")
  9.  
  10.    ' Example XML File:
  11.    '
  12.    '<?xml version="1.0" encoding="Windows-1252"?>
  13.    '<Songs>
  14.    '    <Song><Name>My Song 2.mp3</Name><Year>2007</Year></Song>
  15.    '    <Song><Name>My Song 1.mp3</Name><Year>2009</Year></Song>
  16.    '    <Song><Name>My Song 3.mp3</Name><Year>2008</Year></Song>
  17.    '</Songs>
  18.  
  19.    ' Example output:
  20.    '
  21.    '<?xml version="1.0" encoding="Windows-1252"?>
  22.    '<Songs>
  23.    '    <Song><Name>My Song 1.mp3</Name><Year>2009</Year></Song>
  24.    '    <Song><Name>My Song 2.mp3</Name><Year>2007</Year></Song>
  25.    '    <Song><Name>My Song 3.mp3</Name><Year>2008</Year></Song>
  26.    '</Songs>
  27.  
  28.    Private Function Sort_XML_By_Element(ByVal XML As XDocument, _
  29.                                     ByVal Root_Element As String, _
  30.                                     ByVal Element_to_sort As String) As XDocument
  31.  
  32.        Dim xdoc As XDocument
  33.  
  34.        Try
  35.  
  36.            xdoc = XML
  37.            xdoc.Root.ReplaceNodes(XML.Root.Elements(Root_Element) _
  38.                                  .OrderBy(Function(sort) sort.Element(Element_to_sort).Value))
  39.  
  40.            Return xdoc
  41.  
  42.        Catch ex As Exception
  43.            Throw New Exception(ex.Message)
  44.  
  45.        Finally
  46.            xdoc = Nothing
  47.  
  48.        End Try
  49.  
  50.    End Function
  51.  
  52. #End Region





Un ejemplo de como convertir los elementos de un documento XML a un type anónimo:

Código
  1. #Region " Convert XML to Anonymous Type "
  2.  
  3.        'Dim xml As XDocument = XDocument.Load(xmlfile)
  4.  
  5.        Dim xml As XDocument = _
  6.        <?xml version="1.0" encoding="Windows-1252"?>
  7.        <!--XML Songs Database.-->
  8.        <Songs>
  9.            <Song><Name>My Song 1.mp3</Name><Year>2007</Year><Genre>Dance</Genre><Bitrate>320</Bitrate><Length>04:55</Length><Size>4,80</Size></Song>
  10.            <Song><Name>My Song 2.mp3</Name><Year>2009</Year><Genre>Electro</Genre><Bitrate>192</Bitrate><Length>06:44</Length><Size>8,43</Size></Song>
  11.            <Song><Name>My Song 3.mp3</Name><Year>2008</Year><Genre>UK Hardcore</Genre><Bitrate>128</Bitrate><Length>05:12</Length><Size>4,20</Size></Song>
  12.        </Songs>
  13.  
  14.        Dim SongsList = From song In xml.<Songs>.<Song>
  15.                        Select New With { _
  16.                                          song.<Name>.Value,
  17.                                          song.<Year>.Value,
  18.                                          song.<Genre>.Value,
  19.                                          song.<Bitrate>.Value,
  20.                                          song.<Length>.Value,
  21.                                          song.<Size>.Value _
  22.                                       }
  23.  
  24.        For Each song In SongsList
  25.  
  26.            MsgBox(String.Format("Name:{1}{0}Year:{2}{0}Genre:{3}{0}Bitrate:{4}{0}Length:{5}{0}Size:{6}", _
  27.                                 Environment.NewLine, _
  28.                                 song.Name, song.Year, song.Genre, song.Bitrate, song.Length, song.Size))
  29.  
  30.            ' Output:
  31.            '
  32.            'Name:My Song 1.mp3
  33.            'Year:2007
  34.            'Genre:Dance
  35.            'Bitrate:320
  36.            'Length:04:55
  37.            'Size:4,80
  38.  
  39.        Next
  40.  
  41. #End Region





Un ejemplo de como convertir los elementos de un documento XML a Tuplas

Código
  1. #Region " Convert XML to IEnumerable(Of Tuple) "
  2.  
  3.        'Dim xml As XDocument = XDocument.Load(xmlfile)
  4.  
  5.        Dim xml As XDocument = _
  6.        <?xml version="1.0" encoding="Windows-1252"?>
  7.        <!--XML Songs Database.-->
  8.        <Songs>
  9.            <Song><Name>My Song 1.mp3</Name><Year>2007</Year><Genre>Dance</Genre><Bitrate>320</Bitrate><Length>04:55</Length><Size>4,80</Size></Song>
  10.            <Song><Name>My Song 2.mp3</Name><Year>2009</Year><Genre>Electro</Genre><Bitrate>192</Bitrate><Length>06:44</Length><Size>8,43</Size></Song>
  11.            <Song><Name>My Song 3.mp3</Name><Year>2008</Year><Genre>UK Hardcore</Genre><Bitrate>128</Bitrate><Length>05:12</Length><Size>4,20</Size></Song>
  12.        </Songs>
  13.  
  14.        Dim SongsList As IEnumerable(Of Tuple(Of String, String, String, String, String, String)) = _
  15.            From song In xml.<Songs>.<Song>
  16.            Select Tuple.Create( _
  17.                                 song.<Name>.Value,
  18.                                 song.<Year>.Value,
  19.                                 song.<Genre>.Value,
  20.                                 song.<Bitrate>.Value,
  21.                                 song.<Length>.Value,
  22.                                 song.<Size>.Value _
  23.                               )
  24.  
  25.        For Each song In SongsList
  26.  
  27.            MsgBox(String.Format("Name:{1}{0}Year:{2}{0}Genre:{3}{0}Bitrate:{4}{0}Length:{5}{0}Size:{6}", _
  28.                                 Environment.NewLine, _
  29.                                 song.Item1, song.Item2, song.Item3, song.Item4, song.Item5, song.Item6))
  30.  
  31.            ' Output:
  32.            '
  33.            'Name:My Song 1.mp3
  34.            'Year:2007
  35.            'Genre:Dance
  36.            'Bitrate:320
  37.            'Length:04:55
  38.            'Size:4,80
  39.  
  40.        Next
  41.  
  42. #End Region





Un ejemplo de como usar Arrays 2D

Código
  1.        ' Create Array 2D (2,2)
  2.        Dim MyArray As String(,) = {{"Item 0,0", "Item 0,1"}, {"Item 1,0", "Item 1,1"}, {"Item 2,0", "Item 2,1"}}
  3.  
  4.        ' Set value
  5.        MyArray(0, 1) = "New Item 0,1"
  6.  
  7.        ' Get Value
  8.        MsgBox(MyArray(0, 1))
  9.  
  10.        ' Loop over the Array 2D
  11.        For x As Integer = 0 To MyArray.GetUpperBound(0)
  12.            MsgBox(String.Format("Array 2D {1},0: {2}{0}Array 2D {1},1: {3}", Environment.NewLine, _
  13.                                x, MyArray(x, 0), MyArray(x, 1)))
  14.        Next





Un ejemplo de como crear un Type propio:

Código
  1.    Public Class Type1
  2.  
  3.        Private _Name As String
  4.        Private _Age As Short
  5.  
  6.        Public Property Name() As String
  7.            Get
  8.                Return _Name
  9.            End Get
  10.            Set(ByVal value As String)
  11.                _Name = value
  12.            End Set
  13.        End Property
  14.  
  15.        Public Property Age() As Short
  16.            Get
  17.                Return _Age
  18.            End Get
  19.            Set(ByVal value As Short)
  20.                _Age = value
  21.            End Set
  22.        End Property
  23.  
  24.    End Class
  25.  
  26.    'Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  27.    '
  28.    '    ' Create a list of our own Type and add Elements:
  29.    '    Dim Contacts As New List(Of Type1) From { _
  30.    '        New Type1 With {.Name = "Lucia", .Age = 19}, _
  31.    '        New Type1 With {.Name = "Pepe", .Age = 40} _
  32.    '    }
  33.    '
  34.    '    ' Add another Element
  35.    '    Contacts.Add(New Type1 With {.Name = "Pablo", .Age = 32})
  36.    '
  37.    '    ' Find an Element:
  38.    '    Dim Contact As Type1 = Contacts.Find(Function(x) x.Name = "Lucia")
  39.    '
  40.    '    ' Display Element members:
  41.    '    MsgBox(String.Format("Name: {1}{0}Age: {2}", _
  42.    '                         Environment.NewLine, _
  43.    '                         Contact.Name, Contact.Age))
  44.    '
  45.    '    ' Loop over all Elements:
  46.    '    For Each Element As Type1 In Contacts
  47.    '        MsgBox(String.Format("Name: {1}{0}Age: {2}", _
  48.    '                        Environment.NewLine, _
  49.    '                        Element.Name, Element.Age))
  50.    '    Next
  51.    '
  52.    'End Sub




Una función genérica para obtener el serial de la CPU
(Este snippet fue de los primeros que posteé, le he dado un repaso al código)

Código
  1.    #Region " Get CPU ID "
  2.  
  3.       ' [ Get CPU ID ]
  4.       '
  5.       '// By Elektro H@cker
  6.       '
  7.       ' INSTRUCTIONS:
  8.       ' 1. Add a reference to "System.Management"
  9.       '
  10.       ' Examples :
  11.       ' Dim ProcID As String = Get_CPU_ID()
  12.       ' MsgBox(Get_CPU_ID())
  13.  
  14.    Private Function Get_CPU_ID() As String
  15.  
  16.        Dim wmi As Management.ManagementObjectSearcher = _
  17.            New Management.ManagementObjectSearcher("select * from Win32_Processor")
  18.  
  19.        Dim val As String = wmi.Get(0)("ProcessorID")
  20.  
  21.        wmi.Dispose()
  22.  
  23.        Return val.ToString
  24.  
  25.    End Function
  26.  
  27.    #End Region





Una función genérica para obtener el serial de la placa base
(Este snippet fue de los primeros que posteé, le he dado un repaso al código)

Código
  1.    #Region " Get Motherboard ID "
  2.  
  3.       ' [ Get Motherboard ID ]
  4.       '
  5.       '// By Elektro H@cker
  6.       '
  7.       ' INSTRUCTIONS:
  8.       ' 1. Add a reference to "System.Management"
  9.       '
  10.       ' Examples :
  11.       ' Dim MotherID As String = Get_Motherboard_ID()
  12.       ' MsgBox(Get_Motherboard_ID())
  13.  
  14.    Private Function Get_Motherboard_ID() As String
  15.  
  16.        Dim wmi As Management.ManagementObjectSearcher = _
  17.            New Management.ManagementObjectSearcher("select * from Win32_BaseBoard")
  18.  
  19.        Dim val As String = wmi.Get(0)("SerialNumber")
  20.  
  21.        wmi.Dispose()
  22.  
  23.        Return val
  24.  
  25.    End Function
  26.  
  27.    #End Region





Y por último, unos ejemplos muy sencillos de como manejar un documento XML (sencillo)...
(Uso un XMLTextWritter en lugar de un XMLWriter por la libertad de indentación)

Código
  1. ' [ Song XML Writer Helper ]
  2. '
  3. ' // By Elektro H@cker
  4. '
  5. ' Example usage :
  6. '
  7. 'Private Sub Test()
  8. '
  9. '    ' Set an XML file to create
  10. '    Dim xmlfile As String = "C:\My XML File.xml"
  11. '
  12. '    ' Create the XmlWriter object
  13. '    Dim XmlWriter As Xml.XmlTextWriter = _
  14. '        New Xml.XmlTextWriter(xmlfile, System.Text.Encoding.Default) _
  15. '        With {.Formatting = Xml.Formatting.Indented}
  16. '
  17. '    ' Write the Xml declaration.
  18. '    XMLHelper.Write_Beginning(XmlWriter)
  19. '    ' Output at this point:
  20. '    ' <?xml version="1.0" encoding="Windows-1252"?>
  21. '
  22. '    ' Write a comment.
  23. '    XMLHelper.Write_Comment(XmlWriter, "XML Songs Database", Xml.Formatting.Indented)
  24. '    ' Output at this point:
  25. '    ' <!--XML Songs Database-->
  26. '
  27. '    ' Write the root element.
  28. '    XMLHelper.Write_Beginning_Root_Element(XmlWriter, "Songs", Xml.Formatting.Indented)
  29. '    ' Output at this point:
  30. '    ' <Songs>
  31. '
  32. '    ' Write the start of a song element.
  33. '    XMLHelper.Write_Beginning_Root_Element(XmlWriter, "Song", Xml.Formatting.Indented)
  34. '    ' Output at this point:
  35. '    ' <Song>
  36. '
  37. '    ' Write a song element.
  38. '    XMLHelper.Write_Elements(XmlWriter, { _
  39. '                                         {"Name", "My Song file.mp3"}, _
  40. '                                         {"Year", "2013"}, _
  41. '                                         {"Genre", "Rock"} _
  42. '                                        }, Xml.Formatting.None)        
  43. '    ' Output at this point:
  44. '    ' <Name>My Song file.mp3</Name><Year>2007</Year><Genre>Dance</Genre>
  45. '
  46. '    ' Write the end of a song element.
  47. '    XMLHelper.Write_End_Root_Element(XmlWriter, Xml.Formatting.None)
  48. '    ' Output at this point:
  49. '    ' </Song>
  50. '
  51. '    ' Write the end of the Root element.
  52. '    XMLHelper.Write_End_Root_Element(XmlWriter, Xml.Formatting.Indented)
  53. '    ' Output at this point:
  54. '    ' </Songs>
  55. '
  56. '    ' Write the xml end of file.
  57. '    XMLHelper.Write_End(XmlWriter)
  58. '
  59. '    ' Start the file and exit
  60. '    Process.Start(xmlfile) : Application.Exit()
  61. '
  62. '    ' Final output:
  63. '    '
  64. '    '<?xml version="1.0" encoding="Windows-1252"?>
  65. '    '<!--XML Songs Database-->
  66. '    '<Songs>
  67. '    '  <Song><Name>My Song file.mp3</Name><Year>2007</Year><Genre>Dance</Genre></Song>
  68. '    '</Songs>
  69. '
  70. 'End Sub
  71.  
  72. #Region " XML Helper "
  73.  
  74. Class XMLHelper
  75.  
  76.    ''' <summary>
  77.    ''' Writes the Xml beginning declaration.
  78.    ''' </summary>
  79.    Shared Sub Write_Beginning(ByVal XmlWriter As Xml.XmlTextWriter)
  80.  
  81.        Try
  82.            XmlWriter.WriteStartDocument()
  83.  
  84.        Catch ex As InvalidOperationException
  85.            Dim errormsg As String = "This is not the first write method called after the constructor. "
  86.            Throw New Exception(errormsg & Environment.NewLine & ex.StackTrace)
  87.            ' MessageBox.Show(errormsg)
  88.  
  89.        Catch ex As Exception
  90.            Throw New Exception(ex.Message & Environment.NewLine & ex.StackTrace)
  91.  
  92.        End Try
  93.  
  94.    End Sub
  95.  
  96.    ''' <summary>
  97.    ''' Writes a comment.
  98.    ''' </summary>
  99.    Shared Sub Write_Comment(ByVal XmlWriter As Xml.XmlTextWriter, _
  100.                                  ByVal Comment As String, _
  101.                                  Optional ByVal Indentation As Xml.Formatting = Xml.Formatting.Indented)
  102.  
  103.        Try
  104.            XmlWriter.Formatting = Indentation
  105.            XmlWriter.WriteComment(Comment)
  106.            XmlWriter.Formatting = Not Indentation
  107.  
  108.        Catch ex As ArgumentException
  109.            Dim errormsg As String = "The text would result in a non-well formed XML document"
  110.            Throw New Exception(errormsg & Environment.NewLine & ex.StackTrace)
  111.            ' MessageBox.Show(errormsg)
  112.  
  113.        Catch ex As InvalidOperationException
  114.            Dim errormsg As String = "The ""WriteState"" property is Closed"
  115.            Throw New Exception(errormsg & Environment.NewLine & ex.StackTrace)
  116.            ' MessageBox.Show(errormsg)
  117.  
  118.        Catch ex As Exception
  119.            Throw New Exception(ex.Message & Environment.NewLine & ex.StackTrace)
  120.  
  121.        End Try
  122.  
  123.    End Sub
  124.  
  125.    ''' <summary>
  126.    ''' Writes the beginning of a root element.
  127.    ''' </summary>
  128.    Shared Sub Write_Beginning_Root_Element(ByVal XmlWriter As Xml.XmlTextWriter, _
  129.                                                 ByVal Element As String, _
  130.                                                 Optional ByVal Indentation As Xml.Formatting = Xml.Formatting.Indented)
  131.  
  132.        Try
  133.            XmlWriter.Formatting = Indentation
  134.            XmlWriter.WriteStartElement(Element)
  135.            XmlWriter.Formatting = Not Indentation
  136.  
  137.        Catch ex As System.Text.EncoderFallbackException
  138.            Dim errormsg As String = "There is a character in the buffer that is a valid XML character but is not valid for the output encoding."
  139.            Throw New Exception(errormsg & Environment.NewLine & ex.StackTrace)
  140.            ' MessageBox.Show(errormsg)
  141.  
  142.        Catch ex As InvalidOperationException
  143.            Dim errormsg As String = "The XmlTextWriter is closed or An XmlTextWriter method was called before a previous asynchronous operation finished."
  144.            Throw New Exception(errormsg & Environment.NewLine & ex.StackTrace)
  145.            ' MessageBox.Show(errormsg)
  146.  
  147.        Catch ex As Exception
  148.            Throw New Exception(ex.Message & Environment.NewLine & ex.StackTrace)
  149.  
  150.        End Try
  151.  
  152.    End Sub
  153.  
  154.    ''' <summary>
  155.    ''' Writes the end of a root element.
  156.    ''' </summary>
  157.    Shared Sub Write_End_Root_Element(ByVal XmlWriter As Xml.XmlTextWriter, _
  158.                                           Optional ByVal Indentation As Xml.Formatting = Xml.Formatting.Indented)
  159.  
  160.        Try
  161.            XmlWriter.Formatting = Indentation
  162.            XmlWriter.WriteEndElement()
  163.            XmlWriter.Formatting = Not Indentation
  164.  
  165.        Catch ex As System.Text.EncoderFallbackException
  166.            Dim errormsg As String = "There is a character in the buffer that is a valid XML character but is not valid for the output encoding."
  167.            Throw New Exception(errormsg & Environment.NewLine & ex.StackTrace)
  168.            ' MessageBox.Show(errormsg)
  169.  
  170.        Catch ex As InvalidOperationException
  171.            Dim errormsg As String = "The XmlTextWriter is closed or An XmlTextWriter method was called before a previous asynchronous operation finished."
  172.            Throw New Exception(errormsg & Environment.NewLine & ex.StackTrace)
  173.            ' MessageBox.Show(errormsg)
  174.  
  175.        Catch ex As Exception
  176.            Throw New Exception(ex.Message & Environment.NewLine & ex.StackTrace)
  177.  
  178.        End Try
  179.  
  180.    End Sub
  181.  
  182.    ''' <summary>
  183.    ''' Writes an element.
  184.    ''' </summary>
  185.    Shared Sub Write_Element(ByVal XmlWriter As Xml.XmlTextWriter, _
  186.                                  ByVal StartElement As String, _
  187.                                  ByVal Element As String, _
  188.                                  Optional ByVal Indentation As Xml.Formatting = Xml.Formatting.Indented)
  189.  
  190.        Try
  191.            XmlWriter.Formatting = Indentation
  192.            XmlWriter.WriteStartElement(StartElement)
  193.            XmlWriter.WriteString(Element)
  194.            XmlWriter.WriteEndElement()
  195.            XmlWriter.Formatting = Not Indentation
  196.  
  197.        Catch ex As System.Text.EncoderFallbackException
  198.            Dim errormsg As String = "There is a character in the buffer that is a valid XML character but is not valid for the output encoding."
  199.            Throw New Exception(errormsg & Environment.NewLine & ex.StackTrace)
  200.            ' MessageBox.Show(errormsg)
  201.  
  202.        Catch ex As InvalidOperationException
  203.            Dim errormsg As String = "The XmlTextWriter is closed or An XmlTextWriter method was called before a previous asynchronous operation finished."
  204.            Throw New Exception(errormsg & Environment.NewLine & ex.StackTrace)
  205.            ' MessageBox.Show(errormsg)
  206.  
  207.        Catch ex As Exception
  208.            Throw New Exception(ex.Message & Environment.NewLine & ex.StackTrace)
  209.  
  210.        End Try
  211.  
  212.    End Sub
  213.  
  214.    ''' <summary>
  215.    ''' Writes multiple elements.
  216.    ''' </summary>
  217.    Shared Sub Write_Elements(ByVal XmlWriter As Xml.XmlTextWriter, _
  218.                                   ByVal Elements As String(,), _
  219.                                   Optional ByVal Indentation As Xml.Formatting = Xml.Formatting.Indented)
  220.  
  221.        Try
  222.  
  223.            XmlWriter.Formatting = Indentation
  224.  
  225.            For x As Integer = 0 To Elements.GetUpperBound(0)
  226.                XmlWriter.WriteStartElement(Elements(x, 0))
  227.                XmlWriter.WriteString(Elements(x, 1))
  228.                XmlWriter.WriteEndElement()
  229.            Next
  230.  
  231.            XmlWriter.Formatting = Not Indentation
  232.  
  233.        Catch ex As System.Text.EncoderFallbackException
  234.            Dim errormsg As String = "There is a character in the buffer that is a valid XML character but is not valid for the output encoding."
  235.            Throw New Exception(errormsg & Environment.NewLine & ex.StackTrace)
  236.            ' MessageBox.Show(errormsg)
  237.  
  238.        Catch ex As InvalidOperationException
  239.            Dim errormsg As String = "The XmlTextWriter is closed or An XmlTextWriter method was called before a previous asynchronous operation finished."
  240.            Throw New Exception(errormsg & Environment.NewLine & ex.StackTrace)
  241.            ' MessageBox.Show(errormsg)
  242.  
  243.        Catch ex As Exception
  244.            Throw New Exception(ex.Message & Environment.NewLine & ex.StackTrace)
  245.  
  246.        End Try
  247.  
  248.    End Sub
  249.  
  250.    ''' <summary>
  251.    ''' Writes the xml end of file.
  252.    ''' </summary>
  253.    Shared Sub Write_End(ByVal XmlWriter As Xml.XmlTextWriter)
  254.  
  255.        Try
  256.            XmlWriter.WriteEndDocument()
  257.            XmlWriter.Close()
  258.  
  259.        Catch ex As ArgumentException
  260.            Dim errormsg As String = "The XML document is invalid."
  261.            Throw New Exception(errormsg & Environment.NewLine & ex.StackTrace)
  262.            ' MessageBox.Show(errormsg)
  263.  
  264.        Catch ex As Exception
  265.            Throw New Exception(ex.Message & Environment.NewLine & ex.StackTrace)
  266.  
  267.        End Try
  268.  
  269.    End Sub
  270.  
  271. End Class
  272.  
  273. #End Region
8100  Foros Generales / Foro Libre / Re: ¿Donde encontrar Tests de conducir online?, pero con... en: 25 Octubre 2013, 11:54 am
Gracias chavales

@Shout
Joder, que bueno el PDF, no se como has encontrado algo así xD, con eso ya lo tengo todo resuelto, mil gracias!

@@synthesize
Perdona si te ofendí ayer, pero lo que te dije es un poco cierto... y bueno, se trata de mi madre a la que el gobierno está puteando, así que eso hace que yo esté aún mas susceptible con comentarios negativos.

Un saludo!
Páginas: 1 ... 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 [810] 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 ... 1254
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines