El TecnoBaúl de Kiquenet

Kiquenet boring stories

Archive for the ‘Trucos’ Category

Modify Local Security Policy

Posted by kiquenet en 29 abril 2014

In Windows Server 2012.

In Administrative Tools folder, double click the Local Security Policy icon, expand Account Policies and click Password Policy.

In the right pane double click Password must meet complexity requirements and set it to Disabled. Click OK to save your policy change.

Optionally you can also choose to never let passwords expire. To do this open the Maximum password age policy and set set the value to 0. Click OK to apply the change.

Note: Just make sure to update the GP. go to Command Prompt and type GPUPDATE /FORCE



secedit /export /cfg c:\secpol.cfg
(gc C:\secpol.cfg).replace("PasswordComplexity = 1", "PasswordComplexity = 0") | Out-File C:\secpol.cfg
secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY
rm -force c:\secpol.cfg -confirm:$false

secedit /export /cfg c:\new.cfg
${c:new.cfg}=${c:new.cfg} | % {$_.Replace('PasswordComplexity=1', 'PasswordComplexity=0')}
secedit /configure /db $env:windir\security\new.sdb /cfg c:\new.cfg /areas SECURITYPOLICY
del c:\new.cfg

Posted in PowerShell, Scripts, Trucos, Windows | Etiquetado: , | Leave a Comment »

Automatización en envío de correo: Send Automated Emails using SendEmail and Windows Task Scheduler

Posted by kiquenet en 28 enero 2014

Se puede automatizar el envío de correos aplicando Tareas Programadas de Windows y el comando SendEmail.exe.

Para crear tareas programadas (tasks scheduler) se utiliza el comando schtasks.exe o Start->Programs->Accessories->System Tools->Task Scheduler

Con el comando SendEmail.exe podemos configurar el envío de correos:

Examples below.

  • -f xxxxx@gmail.com : This parameter is the email address that will be the “sender.”
  • -t rdube@yahoo.com : This is the recipient’s email address.
  • -u Monday Status Updates : This is the subject
  • -m Here’s the analytics data for this week! : This is the message body.
  • -a Analytics_Channel1.csv Analytics_Channel2.csv Analytics_Channel3.csv : These are the attachments.
  • -s smtp.gmail.com:587 : SMTP server and port
  • -xu xxxxx@gmail.com : SMTP authentication ID name
  • -xp A1ienz2A51 : SMTP authentication password
  • -o tls=yes : SMTP uses TLS (or SSL)


sendmail2   Send Automated Emails Using SendEmail & Windows Task Scheduler

sendmail3   Send Automated Emails Using SendEmail & Windows Task Scheduler

sendmail4   Send Automated Emails Using SendEmail & Windows Task Scheduler




Posted in Scripts, Trucos | Etiquetado: , , | Leave a Comment »

Sleep command in batch file

Posted by kiquenet en 28 enero 2014

On Windows Vista / Windows 7 you can use the timeout command:

timeout /T [delay in seconds] /NOBREAK > NUL

On previous versions of Windows, you can use the ping command (the ping command has 1000 ms of delay between each iteration):

ping -n [delay in seconds + 1] > NUL

Note: As TCP/IP is now ubiquitous, using ping will usually work, but only if TCP/IP is used (a client Windows machine could use NetBEUI or IPX/SPX instead).

Some versions of Windows (like Windows Server 2003) has the sleep.exe executable:

sleep [delay in seconds]

Note: Windows Resource kit for 2003 (http://www.microsoft.com/en-us/download/details.aspx?id=17657) contains sleep.exe command.



Posted in Scripts, Trucos | Etiquetado: , , | Leave a Comment »

Logs de IIS

Posted by kiquenet en 27 enero 2014

Ruta por defecto:



Otherwise, check under IIS Manager, select the computer on the left pane, and in the middle pane, go under "Logging" in the IIS area. There you will se the default location for all sites (this is however overridable on all sites)

También pueden encontrarse en siguientes rutas: C:\Windows\system32\LogFiles\W3SVC1

En esta ruta un log que contiene sólo los errores:


Comprobar que esté activo:

Programs and Features

then click on

Turn Windows features on or off

on the left side then select

Internet Information Services\World Wide Web Services\Health and Diagnostics\HTTP Logging

Una referencia interesante, y que trata de la configuración de logs en IIS (sección <logFile> de settings)






Posted in IIS, Trucos | Etiquetado: , | Leave a Comment »

Múltiples cuentas en Skype (Portable)

Posted by kiquenet en 6 junio 2013

The text in the Target field of this shortcat(s) should look like this:

X:\PortableSkype\Skype.exe  /datapath:"Data"  /removable  /secondary

where X:\PortableSkype is the folder where Skype.exe file is located in your Portable installation.

You can create as many new shortcuts as you wish and with each login with the respective account. You can actually add the Skype name and password to the path, so the shortcut will automatically login to the selected account.

E:\Portables\SkypePortable\App\Skype\Phone\Skype.exe  /datapath:”Data”  /removable  /secondary  /username:name1  /password:password1

E:\Portables\SkypePortable\App\Skype\Phone\Skype.exe  /datapath:”Data”  /removable  /secondary  /username:name2  /password:password2

E:\Portables\SkypePortable\App\Skype\Phone\Skype.exe  /datapath:”Data”  /removable  /secondary  /username:name3  /password:password3

for MSN account like xxxx@hotmail.com ?

I’m afraid that this will not work with MSN accounts, but you can try.

In any case, in order to be able to login with MSN account, \ProgramData\Skype\Apps\login folder must be present on the computer. Per default, the Portable installation does not install this folder.



Posted in Trucos | Etiquetado: , , , | Leave a Comment »

Hide or Show the Solution File in Solution Explorer

Posted by kiquenet en 31 octubre 2012

If you don’t like seeing the solution file in Solution Explorer, you can easily hide it (or show it if you have it hidden).  First, let’s review what the default looks like with the solution file showing:


Now if we go to Tools -> Options -> Projects and Solutions -> General and uncheck "Always show solution":


This is the result:


SPECIAL NOTE:  This only works when there is one project in the solution.  If you have multiple projects in your solution it will ignore this setting and give you the default view.




Posted in .NET, Trucos, VisualStudio | Etiquetado: , | Leave a Comment »

Conexiones Activas en SQL Server

Posted by kiquenet en 12 agosto 2011

Muchas veces necesitamos saber cuántas conexiones están activas en nuestro servidor SQL Server. Para ello podemos utilizar el siguiente script que nos permitirá saber la cantidad de conexiones existentes por cada base de datos y el login utilizada para las mismas.

SELECT db_name(dbid) as DatabaseName, count(dbid) as NoOfConnections,
loginame as LoginName
FROM sys.sysprocesses
WHERE dbid > 0
GROUP BY dbid, loginame


fuente: mnoguera.com.ar

Posted in SQL, Trucos | Etiquetado: | Leave a Comment »

msvcr71.dll is missing

Posted by kiquenet en 5 agosto 2011

Install SQL Developer on Win 7 64 bit (o 32 bit) might get this error,

The program can’t start because MSVCR71.dll is missing from your computer. Try reinstalling the program to fix this problem.

Just follow the instruction at to fix it


También puede descargarse (free) desde esta dirección:


y después copiar la dll en C:\Windows\system32.


  • Msvcr80.dll para Microsoft Visual C++ 2005
  • Msvcr71.dll para Microsoft Visual C++ .NET 2003 con Microsoft .NET Framework 1.1
  • Msvcr70.dll para Microsoft Visual C++ .NET 2002 con Microsoft .NET Framework 1.0

Referencias: http://tranminhan.wordpress.com/2011/04/05/4380760628/


Posted in Trucos | Leave a Comment »

Xcopy: Insufficient Memory

Posted by kiquenet en 31 enero 2011

El comando xcopy de Windows tiene ciertas limitaciones.

Al copiar una enorme cantidad de ficheros pueden aparecer errores del tipo “Insufficient Memory”.

rmdir /S /Q "%HOMEPATH%\My Documents\Important"

xcopy /E /R /Y /I G:\Important "%HOMEPATH%\My Documents\Important"


Insufficient Memory

Básicamente, hay 3 workarounds para solucionarlo:

  1. Fix paths – Se puede intentar usar unidades virtuales para acortar los paths.
  2. Usar xxcopy – Comando de terceros, clon de xcopy. It was sugerido por David at blogdom.org. Para propósitos comerciales es de pago.
  3. Usar robocopy – Robocopy es parte del Windows Server 2003 Resource Kit. Sólo se instala para Windows XP y 2003, pero funcionará en máquinas compatibles NT (copiando robocopy.exe en las máquinas que lo necesiten).
  4. Otras herramientas (gráficas): Teracopy (comentada por el compañero P.Hevia) , o RichCopy (que apareció en Technet Magazine)



robocopy \\server\share\Important "%HOMEPATH%\My Documents\Important"

"%ProgramFiles%\Windows Resource Kits\Tools\robocopy" C:\Temp\TeamProject\Main C:\Tmp\TeamProject\MainBuild\Sources\Main /S /E





Posted in Scripts, Trucos | Etiquetado: | Leave a Comment »

Detecting if Code is Running from the IDE

Posted by kiquenet en 1 diciembre 2010

During development, you may find that you need your code to determine if is running from the IDE or standalone.

Unlike previous Microsoft development platforms like VB 6, .NET assemblies don’t have a different “mode” when running from the IDE or from the command line. This can make it difficult to figure out how to determine if an assembly is running from the IDE (i.e. from within Visual Studio .NET).

There are several methods of accomplishing this. The simplest is to use the System.Diagnostics.Debugger.IsAttached property to determine if there is a .NET debugger attached to the currently executing code. If there is, you can assume the code is running from the IDE:

// C#

if (Debugger.IsAttached = true)


// Since there is a debugger attached,

// assume we are running from the IDE




// Assume we aren’t running from the IDE


‘ Visual Basic.NET

If Debugger.IsAttached Then

‘ Since there is a debugger attached,

‘ assume we are running from the IDE


‘ Assume we aren’t running from the IDE

End If

User Controls in Runtime Mode

There are also issues with creating your own controls. In some cases, you have code that should not execute in design mode, but should in run mode. In this case, simply use the DesignMode property of the object:

// C#

if (this.DesignMode() = true)


// The component is in design mode




// The component is in run mode


‘ Visual Basic.NET

If Me.DesignMode Then

‘ The component is in design mode


‘ The component is in run mode

End If


Posted in .NET, Trucos | Etiquetado: , | Leave a Comment »