MSCONFIG is a Windows system configuration utility used to manage the startup applications. While this utility does its job of listing all applications (both enabled and disabled), it doesn’t have an option to delete disabled applications even they no long exist as they may already have been uninstalled from the system.

Now, these disabled applications could stay there forever without having any effects on the system but the list could grow very long. If you don’t want this list to continue to grow, you could remove the unwanted items from the list by editing the Windows registry. There are also a number of third party utilities to help take care of these unwanted items on the list. I prefer to directly edit the registry as some of these tools might prove to be harmful.

Locations of the entries in MSConfig:

The enabled/checked items are populated from the following locations:

HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Windows \ CurrentVersion \ Run

HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Run

and

HKEY_CURRENT_USER \ Software \ Microsoft \ Windows NT \ CurrentVersion \ Windows

Values named Run & Load

The disabled entries are present in these locations:

HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Shared Tools \ MSConfig \ startupreg

HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Shared Tools \ MSConfig \ startupfolder

To remove these entries, you first have to start the registry editor (regedit.exe), backup the folder MSConfig before deleting the unwanted items’ folders.

After doing this, all the deleted entries should disappear from the MSConfig startup.

Be careful NOT to break your system. Once again remember to backup before deletion.

A common security concern at organizations is allowing users to plug in a usb flash drive, because they could so easily copy corporate data.
 
To Enable or Disable USB port:
 
1. Method:
 
1. Click Start, and then click Run.
2. In the Open box, type regedit, and then click OK.
3. Locate, and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor
4. In the right pane, double-click Start.
5. In the Value data box, type 3 to Enable and 4 to disable, click Hexadecimal (if it is not already selected), and then click OK.
6. Quit Registry Editor.
 
2. Method:
 
Since Windows XP SP2, you can disable writing to USB devices altogether using a simple registry hack. Here it is:
 
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies]
“WriteProtect”=dword:00000001
 
You can also just download one of the following registry tweaks to enable or disable writing to USB drives.
 
Enable USB Write
 
Disable USB Write
 
Once you use the registry hack, you will have to reboot for the changes to take effect. One should also note that if you are using this trick, you should make sure that the users are not administrators on the computer, because they could easily change this setting back.
 
This works on Windows Vista as well. Here’s the window you’ll get when you try and write to a USB drive: 
 
 
To Enable or Disable CD/DVD  ROMport:
 
1. Click Start, and then click Run.
2. In the Open box, type regedit, and then click OK.
3. Locate, and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\cdrom
4. In the right pane, double-click Start.
5. In the Value data box, type 1 to Enable and 4 to disable, click Hexadecimal (if it is not already selected), and then click OK.
6. Quit Registry Editor.
 

As we know ‘sa‘ login is the default administrative user for MSSQL server. It is therefore very essential to regularly change the password for security reasons. Below is two ways approach in changing the ‘sa’ or other user’s password easily on the command line.

 

SOLUTION 1:

Execute the following commands from the Windows prompt of your server:

a) First list all the MSSQL servers near you with this command.

    osql -L

b) Connect to your server found (along with others) on the list using an administrator account.

    osql -S servername -E

    Note: The servername consist of the ‘HOSTNAME\INSTANCE’ (example ‘ZEUS\HOSTDB’)

              whereby ZEUS is the hostname and HOSTDB the instance

c) Enter the following query commands to change the ‘sa’ pasword.

    sp_password NULL,’new_password’,'sa’

    go

d) Quit and exit the Windows command line.

    quit

    exit

Try now to connect to the MSSQL server using ‘sa’ with the new password.

 

SOLUTION 2:

I have written a batch script to automate the process.

So, open up the notepad or any other editor your prefere and enter the following:

REM ========================== START ====================================

 

@echo off

SetLocal EnableDelayedExpansion

mode con:cols=78 lines=30

color 3

TITLE MSSQL PASSWORD CHANGER

:User

REM Prompt the user for the user name

cls

echo.

set User=

set /P User=”Enter the user name: ”

if not defined User goto User

:OldPasswd

REM Prompt the user for the old password

cls

echo.

set OldPasswd=

set /P OldPasswd=”Enter the old password: ”

if not defined OldPasswd goto OldPasswd

:NewPasswd

REM Prompt the user for the new password

cls

echo.

set NewPasswd=

set /P NewPasswd=”Enter the new password: ”

if not defined NewPasswd goto NewPasswd

:ChangePasswd

cls

echo.

echo Wait while the new password is been implemented…

ping -n 3 127.0.0.1 >nul

osql -U %User% -P “%OldPasswd%” -Q “sp_password NULL,%NewPasswd%,%User%

echo.

echo The passowrd for %User% has been changed.

echo Press any key to end the program!

pause>nul

echo.

echo bye ^;-^)

ping -n 3 127.0.0.1 >nul

goto :EoF

REM =========================== END =======================================

Copy and save this as a batch file with the name “ChgSQLPasswd.bat” or click ChgSQLPasswd.bat to download it

Written on September 27th, 2012 , MSSQL, Recent Posts, SQL, Windows, Windows 2003, Windows 2008

One thing I have noticed trying to import SQL Server 2005 Registered Servers is, it always fail with errors. The import function is simply isn’t good enough.

To work around this, just do the following:

a) On the SQL Server 2005, shutdown the SQL Server Management Studio (SSMS) and copy out “RegSrvr.xml” from this location

      “%AppData%\Microsoft\Microsoft SQL Server\90\Tools\Shell\RegSrvr.xml”

b) Paste the copied file in the same location where SQL Server 2008 is installed

    Windows 2003:

    ”%AppData%\Microsoft\Microsoft SQL Server\90\Tools\Shell\RegSrvr.xml”

    Windows 2008:

    “%UserName%\AppData\Roaming\Microsoft\Microsoft SQL Server\90\Tools\Shell\RegSrvr.xml”

    **) You may have to create the folders: 90 \Tools\Shell

c) Open SSMS 2008 and right click “Local Server Groups” in the “Registered Servers” window

d) Choose “Tasks | Previous Registered Servers”

 

**) It is important to point out that the file “RegSrvr.xml” should be edited to clear all password references before copying into SQL Server 2008 installation folder.

Written on September 13th, 2012 , Windows, Windows 2003, Windows 2008, Windows 7, Windows XP

Mapping network shares from a network is a pretty easy thing to do. The standard command for this in windows is:

net use x: \\{host}\{share} {password} /u:{unsername} /p:{no|yes}

where:

x = drive letter (a-z)

p = persistent (yes means re-map after system restart and no means the opposite)

Assuming you want to automate such action mapping more shares from different networks, you will want to use the FOR loop in a batch script. These steps will show my aproach:

 

1.) The first thing to do is create and place all your share information (host, share, password, username and drive letters in a file and name the file anything you want. To suite my purpose, I’ll jsut name the file “dat2″ without any file extention. The content should look like this:

01,10.11.11.21,username,password,t,share

02,172.16.10.21,username,password,u,share

03,195.34.13.21,username,password,v,share

04,192.168.0.21,username,password,w,share

 

2.) Create a batch script to disconnect all existing network drives. Let’s name this file “delmap.bat”

 

REM ======================= Begin Of Script =============================

@echo off

REM Check and disconnect all existing network drives

cls

if exist t: net use /del t: /y

if exist u: net use /del u: /y

if exist v: net use /del v: /y

if exist w: net use /del w: /y

 

goto :EOF

REM ======================= End Of Script =============================

 

3.) Now, we can create the main script “NetShare.bat” with the following contents:

 

REM ======================= Begin Of Script =============================

 

@echo off

REM To avoid error messages, check and disconnect all existing network drives

REM by calling another batch file named delmap.bat.

cls

call “%~dp0\delmap.bat”

REM To avoid unexpected errors, the system needs to wait 3 seconds after

REM disconnecting all existing drives before re-mapping the network resources.

REM All pre-defined parameters in the file (dat2) will be fetched line by line using

REM the (for) loop. There are 6 columns in the file (dat2) separated by commas (delims).

REM The first is the line numbers (not needed). That is the reason why the tokens is

REM defined from 2-6. The pre-defined variables (hostN, userN, paswd, drive and share) are

REM passed one by one from the ‘sub routine’ (:var) to process the mapping of the drives.

cls

ping -n 3 127.0.0.1>nul

for /F “tokens=2-6 delims=,” %%g IN (%~dp0dat2) do call :var %%g %%h %%i %%j %%k

goto end

:var

set hostN=%1

set userN=%2

set paswd=%3

set drive=%4

set share=%5

net use %drive%: \\%hostN%\%share% %paswd% /U:%userN% /P:no

goto :EOF

:end

exit

REM ======================= End Of Script =============================

 

 

Download:

Both files NetShare.bat and delmap.bat are included in the dowload below:

NetShare

You need to create  your share information (dat2) by following the first step above.

OMOTECH Tips & Tricks is proudly powered by WordPress and the Theme Adventure by Eric Schwarz
Entries (RSS) and Comments (RSS).

OMOTECH Tips & Tricks

this blog offers tutorials based on various it-subjects