Save these commands as a .cmd file:
@ECHO OFF
CLS
ECHO Disabling network interfaces.
netsh interface set interface "Local Area Connection" DISABLE
netsh interface set interface "Wireless Network Connection" DISABLE
ECHO Enabling network interfaces
netsh interface set interface "Local Area Connection" ENABLE
netsh interface set interface "Wireless Network Connection" ENABLE
PAUSE
*This has only been tested with Windows 7
Tuesday, December 4, 2012
Wednesday, October 31, 2012
Default Gateway Ping Test Batch File
This is a batch file that will let you test your connection status by pinging your default gateway. Copy this code into notepad and save the file with a .BAT or .CMD extension.
*This has only been tested with Windows 7. YMMV
@ECHO OFF
COLOR 1F
TITLE GATEWAY PING TEST
:PINGTEST
CLS
FOR /F "TOKENS=2 DELIMS=:" %%G IN ('IPCONFIG ^| find "Default Gateway"') DO (
IF NOT "%%G"==" " (
PING -w 30000 -n 1 %%G
IF ERRORLEVEL 1 ECHO UNABLE TO PING GATEWAY!!!
)
)
ECHO.
CHOICE /T 5 /D Y /M "WAITING 5 SECONDS BEFORE RETRY"
GOTO PINGTEST
*This has only been tested with Windows 7. YMMV
Friday, October 5, 2012
Erasing or Wiping a Floppy Disk
Apparently
there is a new switch to the format command that will let wipe a disk
with multiple passes of writing 0 to the sector. For example:
format A: /P:3 /V:
will erase disk A: writing 3 passes of zero on each sector. "/V:" is
for blanking the volume label. The disk is still usable but the old
data is not recoverable. (Checked with PC Inspector File Recovery)
This works with Vista and higher.
Tuesday, May 15, 2012
Free Online Virus Scanners
This is where I'm keeping my list of free scanners. I may even update this list on a semi-frequent basis.
This is not a virus scanner, but it will analyze unknown binaries or links.
- ESET: http://www.eset.com/us/online-scanner/
- Bitdefender: http://www.bitdefender.com/scanner/online/free.html
- Trend-Micro HouseCall: http://housecall.trendmicro.com/
- Microsoft Security Essentials: http://windows.microsoft.com/en-US/windows/products/security-essentials
- Clamwin: http://www.clamwin.com/content/view/18/46/
This is not a virus scanner, but it will analyze unknown binaries or links.
Tuesday, April 17, 2012
Setting or changing a computer description.
You can right-click "My Computer" and set the computer description:
You can also do it from the command line:
You can use the computer description to identify who owns a computer without infringing on the company naming policy.
If you are on a Windows 7 system and cannot see the description, create a folder named "Network.{208d2c60-3aea-1069-a2d7-08002b30309d}" (without the quotes).
More info: http://blog.chrisara.com.au/2009/08/restoring-computer-description-in.html
You can also do it from the command line:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32>net config server /srvcomment:"Brian Hart's Notebook"
The command completed successfully.
You can use the computer description to identify who owns a computer without infringing on the company naming policy.
If you are on a Windows 7 system and cannot see the description, create a folder named "Network.{208d2c60-3aea-1069-a2d7-08002b30309d}" (without the quotes).
More info: http://blog.chrisara.com.au/2009/08/restoring-computer-description-in.html
Tuesday, April 3, 2012
Quickly Add or Remove Programs.
If you want to quickly Add or Remove a program from windows you can type "appwiz.cpl" in your Win7 search box or your XP Start->Run box.
Remember it as the "Application Wizard in my Control Panel".
Why do we want to do this? More on that later.
Remember it as the "Application Wizard in my Control Panel".
Why do we want to do this? More on that later.
Monday, April 2, 2012
Protecting your external hard drive data.
Always put your your external hard drive on the floor. Somewhere it won't get kicked or stepped on, like under the coffee table. It's already as low as it can get so it can't get dropped and lose all your family pictures and Justin Beiber tunes.
Thursday, March 1, 2012
How to hide Excel data query authentication settings.
Sometimes it's easier (lazier?) to use an Excel query for simple reports. One problem with this is that the query authentication properties are viewable to anyone who has access to the report. While this is like teaching a dog algebra for the average user, an advanced user could, conceivably, use this connection data to create their own, unauthorized queries.
While there is no way that I know of to hide the query information, you can create a set of protected procedures that:
While there is no way that I know of to hide the query information, you can create a set of protected procedures that:
- adds the authentication (connection string)
- runs the query
- then removes it again.
- First you'll want to create a new VBA module in your Excel worksheet with procedures that look something like this:
Sub AddConnect()
'this will add the connection string to
'all connections in the active workbook
For Each CN In ActiveWorkbook.Connections
CN.ODBCConnection.BackgroundQuery = False 'this line is optional
CN.ODBCConnection.Connection = _
"ODBC;DRIVER={Progress OpenEdge 10.1C Driver};" & _
"UID=YOURUSERNAME;PWD=YOURPASSWORD;" & _
"HOST=YOURHOST;PORT=YOURPORT;DB=YOURDATABASE;" & _
"DefaultIsolationLevel=READUNCOMMITTED"
Next
End Sub
Sub RemoveConnect()
'this will remove the connection string from
'all connections in the active workbook
For Each CN In ActiveWorkbook.Connections
CN.ODBCConnection.Connection = "ODBC;"
Next
End Sub
Sub ListConnections()
'this will list all query connection strings
'in the active workbook
For Each CN In ActiveWorkbook.Connections
MsgBox (CN.ODBCConnection.Connection)
Next
End Sub
Sub RefreshAll()
'this will refresh all the data connections in the active workbook
AddConnect 'add the connection strings
ActiveWorkbook.RefreshAll 'refresh all connections
RemoveConnect 'remove the connection strings
End Sub - You can then password protect the module by right-clicking it and selecting properties.
- Then check "Lock project for viewing" and enter your password. Finally, click OK.
- You can then add a command button to your worksheet with the macro assigned to RefreshAll().
Subscribe to:
Posts (Atom)