Wednesday, May 28, 2008

Vista Does Not Like WEP

I have spent days trying to get a new Vista Laptop to connect to a WEP-encrypted network...with much frustration. At first I got it to the point where I entered a WEP passphrase but then it was asking me for a domain logon. That would be fine if there was 802.11 Authentication, but there was none. At one point it finally connected, i have no idea how, and it worked for a few days. However, when it got disconnected, i could never reconnect. After many retries and getting authentication dialogs and could not login errors, i turned to some searching. After not finding much helpful information online, i was about to try just going unsecured, but i saw a post that said Vista drops WEP in and out. So i switched to WPA2 and Vista seems to be ok with that. We have a saying for this at work...VISATA SUCKS!

So if you have any Vista machines on your network, you probably want to try something other than WEP for encryption. Not to mention WEP's numerous vulnerabilities.

Friday, May 2, 2008

Batch Function for String Padding


::=======================================================
:padStringLeft string width padCharacter
:: author: wwjdcsk
:: -- pads the front of a string with specified characters to the width specified
::=======================================================
:: -- string [in,out] - time to be formatted, mutated
:: -- width [in] - width of resulting string
:: -- character [in,opt] - character to pad with, default is space
SETLOCAL ENABLEDELAYEDEXPANSION
call set inStr=%%%~1%%
set width=%2
set /a width-=1
set pad=%3
if "%pad%"=="" set pad= &::space

for /l %%i in (0,1,%width%) do (
if "!inStr:~%%i,1!"=="" set inStr=%pad%!inStr!
)

( ENDLOCAL & REM -- RETURN VALUES
IF "%~1" NEQ "" SET "%~1=%inStr%"
)
goto :eof



::=======================================================
:padStringRight string width padCharacter
:: author: wwjdcsk
:: -- pads the back of a string with specified characters to the width specified
::=======================================================
:: -- string [in,out] - time to be formatted, mutated
:: -- width [in] - width of resulting string
:: -- character [in,opt] - character to pad with, default is space
SETLOCAL ENABLEDELAYEDEXPANSION
call set inStr=%%%~1%%
set width=%2
set /a width-=1
set pad=%3
if "%pad%"=="" set pad= &::space

for /l %%i in (0,1,%width%) do (
if "!inStr:~%%i,1!"=="" set inStr=!inStr!%pad%
)

( ENDLOCAL & REM -- RETURN VALUES
IF "%~1" NEQ "" SET "%~1=%inStr%"
)
goto :eof

Functions in Batch


Most people underestimate the power of batch scripting...did you know you can have functions in batch files?  Yes, you can!! fully re-enterant ones too...

Here's a good tutorial on how to make batch functions:
http://www.dostips.com/DtTutoFunctions.php

Here are some good batch scripting references that I use:
http://www.robvanderwoude.com/batchfiles.html
http://www.ss64.com/nt/
http://www.dostips.com/