Quickly Enable or Disable Windows Features On The Command Prompt

Microsoft no longer includes certain features to windows systems starting from windows vista by default.  It is still available but must be installed or enabled by the user.  The normal way to enabled these features is through the “Turn Windows features on or off” window found in Control Panel.  This accomplishes the task but can be annoying when you are working in Command Prompt and need to use the telnet command immediately.

Instead of going to Control Panel, the following way is considered better by many administrators (including me).  Simply run this command with elevated administrative rights at the command prompt:

dism /online /Enable-Feature /FeatureName:TelnetServer

Enabling Windows Feature - Telnet Server

The Telnet Server should be immediately available after the dism command has successfully been completed.

Windows Feature - Telnet Server


Posted in Recent Posts, Windows, Windows 7, Windows Features, Windows Vista by with comments disabled.

Xampp 1.8.3 with phpmyadmin 4.1.12 Storage Configuration NOT Complete

I recently installed the latest Xampp with phpMyAdmin version 4.1.12 and noticed the following error messages after the installation process:

The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click [here].

… and clicking the link showed the following errors:

$cfg[‘Servers’][$i][‘users’] … not OK [ Documentation ]

$cfg[‘Servers’][$i][‘usergroups’] … not OK [ Documentation ] Configurable menus: Disabled

$cfg[‘Servers’][$i][‘navigationhiding’] … not OK [ Documentation ] Hide/show navigation items: Disabled

The fix is simple:

STEP1:

Run the following query on the phpmyadmin database:

==================== START ===================

CREATE TABLE IF NOT EXISTS `pma_users` (

  `username` varchar(64) NOT NULL,

  `usergroup` varchar(64) NOT NULL,

  PRIMARY KEY (`username`,`usergroup`)

  COMMENT=’Users and their assignments to user groups’

  DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;

 

CREATE TABLE IF NOT EXISTS `pma_usergroups` (

  `usergroup` varchar(64) NOT NULL,

  `tab` varchar(64) NOT NULL,

  `allowed` enum(‘Y’,’N’) NOT NULL DEFAULT ‘N’,

  PRIMARY KEY (`usergroup`,`tab`,`allowed`)

  COMMENT=’User groups with configured menu items’

  DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;

 

CREATE TABLE IF NOT EXISTS `pma_navigationhiding` (

  `username` varchar(64) NOT NULL,

  `item_name` varchar(64) NOT NULL,

  `item_type` varchar(64) NOT NULL,

  `db_name` varchar(64) NOT NULL,

  `table_name` varchar(64) NOT NULL,

  PRIMARY KEY (`username`,`item_name`,`item_type`,`db_name`,`table_name`)

  COMMENT=’Hidden items of navigation tree’

  DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;

==================== STOP ===================

STEP2:

Add the following lines to your phpMyAdmin config.inc.php file:

$cfg[‘Servers’][$i][‘users’] = ‘pma_users’;

$cfg[‘Servers’][$i][‘usergroups’] = ‘pma_usergroups’;

$cfg[‘Servers’][$i][‘navigationhiding’] = ‘pma_navigationhiding’;

STEP3:

Logout and log back into phpMyAdmin

That’s it!

Enjoy 😉

 

Update:

Upgrading to phpMyAdmin 4.2.5 caused a similar problem but with ONLY one error.

$cfg[‘Servers’][$i][‘savedsearches’] … not OK [ Documentation ] Saved searches: Disabled

The solution is simply the same as above…

Execute the following query:

==================== START ===================

CREATE TABLE IF NOT EXISTS `pma_savedsearches` (

  `id` int(5) unsigned NOT NULL auto_increment,

  `username` varchar(64) NOT NULL default ”,

  `db_name` varchar(64) NOT NULL default ”,

  `search_name` varchar(64) NOT NULL default ”,

  `search_data` text NOT NULL,

  PRIMARY KEY  (`id`),

  UNIQUE KEY `u_savedsearches_username_dbname` (`username`,`db_name`,`search_name`)

)

  COMMENT=’Saved searches’

  DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;

==================== STOP ===================

STEP2:

Add the following lines to your phpMyAdmin config.inc.php file:

$cfg[‘Servers’][$i][‘savedsearches’] = ‘pma_savedsearches’;

STEP3:

Logout and log back into phpMyAdmin


Posted in Vista, Web Design, Windows, Windows 7, Windows Vista, Windows XP and tagged , , , , , by with comments disabled.

Huge list of Windows 7 Shell Commands

Below is a huge list of Windows 7 Shell commands that are incredibly useful when creating shortcuts or quickly accessing hard to get to locations. I got this list some time ago from somewhere in the internet and decided to repost it here for my easy reach. They can be used to pin shortcuts to the Taskbar or just to make your life easier.  For those that are preceded by “Shell:” when using them in shortcuts you need to add “explorer.exe” in front of them.  It should then look like this: explorer.exe shell:Personal

Windows 7 Only
shell:Libraries
shell:MusicLibrary
shell:VideosLibrary
shell:OtherUsersFolder
shell:Device Metadata Store
shell:PublicSuggestedLocations
shell:DocumentsLibrary
shell:User Pinned
shell:UsersLibrariesFolder
shell:PicturesLibrary
shell:ImplicitAppShortcuts
shell:Ringtones
shell:CommonRingtones

Windows Vista & 7
shell:Common Programs
shell:GameTasks
shell:UserProfiles
shell:MyComputerFolder
shell:SyncSetupFolder
shell:DpapiKeys
shell:SamplePlaylists
shell:Favorites
shell:My Video
shell:SearchHomeFolder
shell:System
shell:CommonVideo
shell:SyncResultsFolder
shell:LocalizedResourcesDir
shell:Cookies
shell:Original Images
shell:CommonMusic
shell:My Pictures
shell:Cache
shell:Downloads
shell:CommonDownloads
shell:AppData
shell:SyncCenterFolder
shell:My Music
shell:ConflictFolder
shell:SavedGames
shell:InternetFolder
shell:Quick Launch
shell:SystemCertificates
shell:Contacts
shell:TreePropertiesFolder
shell:Profile
shell:Start Menu
shell:Common AppData
shell:PhotoAlbums
shell:ConnectionsFolder
shell:Administrative Tools
shell:PrintersFolder
shell:Default Gadgets
shell:ProgramFilesX86
shell:Searches
shell:Common Startup
shell:ControlPanelFolder
shell:SampleVideos
shell:SendTo
shell:ResourceDir
shell:ProgramFiles
shell:CredentialManager
shell:PrintHood
shell:MAPIFolder
shell:CD Burning
shell:AppUpdatesFolder
shell:Common Start Menu
shell:LocalAppDataLow
shell:Templates
shell:Gadgets
shell:Programs
shell:Recent
shell:SampleMusic
shell:Desktop
shell:CommonPictures
shell:RecycleBinFolder
shell:CryptoKeys
shell:Common Templates
shell:Startup
shell:Links
shell:OEM Links
shell:SamplePictures
shell:Common Desktop
shell:NetHood
shell:Games
shell:Common Administrative Tools
shell:NetworkPlacesFolder
shell:SystemX86
shell:History
shell:AddNewProgramsFolder
shell:Playlists
shell:ProgramFilesCommonX86
shell:PublicGameTasks
shell:ChangeRemoveProgramsFolder
shell:Public
shell:Common Documents
shell:CSCFolder
shell:Local AppData
shell:Windows
shell:UsersFilesFolder
shell:ProgramFilesCommon
shell:Fonts
shell:Personal

Windows 7 Shortcuts
I compiled the following list with an early Alpha build of Windows 7.  It is possible that some of these have changed with newer versions.  If you find one that is wrong please let me know so I can correct it.

Wireless Networks pop-up
rundll32.exe van.dll,RunVAN

Advanced Restore
sdclt.exe /restorewizardadmin

Restore Files
sdclt.exe /restorewizard

Backup Location & Settings
sdclt.exe /configure

Add Network Location (wizard)
rundll32.exe shwebsvc.dll,AddNetPlaceRunDll

Indexing Options
control.exe srchadmin.dll

Notification Cache
rundll32.exe shell32.dll,Options_RunDLL 5

Aero (Transparency) Off
Rundll32.exe DwmApi #104

Aero (Transparency) On
Rundll32.exe DwmApi #102

Welcome Center
rundll32.exe oobefldr.dll,ShowWelcomeCenter

Add/Remove Programs
RunDll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,0

Content Advisor
RunDll32.exe msrating.dll,RatingSetupUI

Control Panel
RunDll32.exe shell32.dll,Control_RunDLL

Date and Time Properties
RunDll32.exe shell32.dll,Control_RunDLL timedate.cpl

Display Settings
RunDll32.exe shell32.dll,Control_RunDLL access.cpl,,3

Device Manager
RunDll32.exe devmgr.dll DeviceManager_Execute

Folder Options – File Types
RunDll32.exe shell32.dll,Control_Options 2

Folder Options – General
RunDll32.exe shell32.dll,Options_RunDLL 0

Folder Options – Search
RunDll32.exe shell32.dll,Options_RunDLL 2

Folder Options – View
RunDll32.exe shell32.dll,Options_RunDLL 7

Forgotten Password Wizard
RunDll32.exe keymgr.dll,PRShowSaveWizardExW

Hibernate
RunDll32.exe powrprof.dll,SetSuspendState

Keyboard Properties
RunDll32.exe shell32.dll,Control_RunDLL main.cpl @1

Lock Screen
RunDll32.exe user32.dll,LockWorkStation

Mouse Properties
RunDll32.exe shell32.dll,Control_RunDLL main.cpl @0

Map Network Drive
RunDll32.exe shell32.dll,SHHelpShortcuts_RunDLL Connect

Network Connections
RunDll32.exe shell32.dll,Control_RunDLL ncpa.cpl

Power Options
RunDll32.exe Shell32.dll,Control_RunDLL powercfg.cpl

Regional Settings
RunDll32.exe shell32.dll,Control_RunDLL intl.cpl,,3

Stored Usernames and Passwords
RunDll32.exe keymgr.dll,KRShowKeyMgr

System Properties: Advanced
RunDll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,4

System Properties: Automatic Updates
RunDll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,5

Taskbar Properties
RunDll32.exe shell32.dll,Options_RunDLL 1

User Accounts
RunDll32.exe shell32.dll,Control_RunDLL nusrmgr.cpl

Windows Security Center
RunDll32.exe shell32.dll,Control_RunDLL wscui.cpl

Windows – About
RunDll32.exe SHELL32.DLL,ShellAboutW

Unplug/Eject Hardware
RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll

Windows Firewall
RunDll32.exe shell32.dll,Control_RunDLL firewall.cpl

Wireless Network Setup
RunDll32.exe shell32.dll,Control_RunDLL NetSetup.cpl,@0,WNSW

Open Control Panel (All Items)
explorer.exe shell:::{21ec2020-3aea-1069-a2dd-08002b30309d}

Manage Wireless Networks
explorer.exe shell:::{1fa9085f-25a2-489b-85d4-86326eedcd87}

Sound Control Playback Tab
rundll32.exe shell32.dll,Control_RunDLLmmsys.cpl

Sound Control Sounds Tab
rundll32.exe shell32.dll,Control_RunDLLmmsys.cpl,,2

Sound Control Recording Tab
rundll32.exe shell32.dll,Control_RunDLLmmsys.cpl,,1

Add/Remove Programs
rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl

Add/Remove Windows Components
rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,2

Set Program Access and Computer Defaults
rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,3

People Near Me
rundll32.exe shell32.dll,Control_RunDLL collab.cpl

People Near Me Sign In Tab
rundll32.exe shell32.dll,Control_RunDLL collab.cpl,,1

Screen Resolution
rundll32.exe shell32.dll,Control_RunDLL desk.cpl

Personalization
rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,2

Screen Saver
rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1

Windows Firewall
rundll32.exe shell32.dll,Control_RunDLL firewall.cpl

Device Manager
rundll32.exe shell32.dll,Control_RunDLL hdwwiz.cpl

Power Options
rundll32.exe shell32.dll,Control_RunDLL powercfg.cpl

Power Options Change Plan Settings
rundll32.exe shell32.dll,Control_RunDLL powercfg.cpl,,1

System Properties
rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl

System Properties Hardware Tab
rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,2

System Properties Advanced Tab
rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,3

System Properties System Protection Tab
rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,4

System Properties Remote Tab
rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,5

Pen and Touch Tablet PC Settings
rundll32.exe shell32.dll,Control_RunDLL tabletpc.cpl

Pen and Touch Tablet PC Settings Flicks Tab
rundll32.exe shell32.dll,Control_RunDLL tabletpc.cpl,,1

Pen and Touch Tablet PC Settings Handwriting Tab
rundll32.exe shell32.dll,Control_RunDLL tabletpc.cpl,,2

Phone and Modem Options
rundll32.exe shell32.dll,Control_RunDLL telephon.cpl

Phone and Modem Options Modems Tab
rundll32.exe shell32.dll,Control_RunDLL telephon.cpl,,1

Phone and Modems Options Advanced Tab
rundll32.exe shell32.dll,Control_RunDLL telephon.cpl,,2

Date and Time
rundll32.exe shell32.dll,Control_RunDLL timedate.cpl

Date and Time Additional Clocks
rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,1

Action Center
rundll32.exe shell32.dll,Control_RunDLL wscui.cpl

Unplug/Eject Hardware
RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll

Internet Explorer Specific Commands

Delete Temporary Internet Files:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8

Delete Cookies:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2

Delete History:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1

Delete Form Data:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16

Delete Passwords:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32

Delete All:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255

Delete All + files and settings stored by Add-ons:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351

Miscellaneous Variables

Windows Directory
%WINDIR%
%SYSTEMROOT%

Hard Drive That Contains OS
%HOMEDRIVE%

Users Home Directory
%HOMEPATH%
%USERPROFILE%

Default Temporary Directory
%TEMP%
%TMP%

Program Files
%PROGRAMFILES%

Current Users Application Data Directory
%APPDATA%

If anyone has additional ones that I have missed you can submit them and I will add them to this list


Posted in Vista, Windows, Windows 7, Windows Vista and tagged , , by with comments disabled.

How To Clean The MSCONFIG Startup

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.


Posted in Vista, Windows, Windows 7 and tagged , , , by with comments disabled.

Enable or Disable CDROM and USB Port On Windows Systems

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.
 

Posted in Windows and tagged , , , , by with comments disabled.

Knowledgebase – Useful Links

Linux

1.) Linux Servers: http://www.brennan.id.au/index.html

2.) Fix FTP Passive mode Problems: https://www.gosquared.com/blog/archives/936

3.) Ways to add swap space using ‘dd’: http://www.thegeekstuff.com/2010/08/how-to-add-swap-space/

4.) CentOS 6.3 Netinstall Guide: http://www.if-not-true-then-false.com/2011/centos-6-netinstall-network-installation/

5.) Linux User Guide: http://www.comptechdoc.org/os/linux/usersguide/index.html

 

Windows


Posted in Linux, Networking, Web Design, Windows and tagged , by with comments disabled.

How To Change MSSQL ‘sa’ Password On The Windows Command Line

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


Posted in MSSQL, SQL, Windows and tagged , , , , , , by with comments disabled.

Importing SQL Server 2005 Registered Servers to SQL Server 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.


Posted in MSSQL, SQL, SQL Management Studio, Windows and tagged , , , , by with comments disabled.

How To Use FOR Loop To map Network Shares From Different Networks Resources

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.


Posted in Windows and tagged , , , , , by with comments disabled.

How To Reset And Change Local Administrator Password On Remote Windows Systems

This tutorial will show you how to reset and change local administrator password on remote windows systems. This was tested on Windows XP and Windows 2003 server but should work on Vista/7/2008 operating systems.

STEPS:

1.) Download the official PsTools from microsoft directly or click here

2.) Extract the downloaded file to a folder called PsTools

3.) Just copy pspasswd.exe to your executable path “C:\Windows\System32”

4.) Open the prompt command line (star -> Run (type “cmd” + OK) and type in the following:

pspasswd \\{IP-Address} -u administrator -p {OldPasswd} administrator {NewPasswd}

whereby:

{OldPasswd} = Old Password

{NewPasswd} = New Password

{IP-Address} = System IP Address

Reset and Change Local Administrator Password On Remote Windows System

Typing “pspasswd” displays its usage syntax.

Usage: pspasswd [\\[computer[,computer,[,…]|Domain]|@file] [-u Username [-p Pa

ssword]]] Username [NewPassword]

     computer    Direct PsPasswd to perform the command on the remote

                 computer or computers specified. If you omit the computer

                 name PsPasswd runs the command on the local system,

                 and if you specify a wildcard (\\*), PsPasswd runs the

                 command on all computers in the current domain.

     @file       PsPasswd will change the password on the computers listed

                 in the file.

     -u          Specifies optional user name for login to remote

                 computer.

     -p          Specifies optional password for user name. If you omit this

                 you will be prompted to enter a hidden password.

     Username    Specifies name of account for password change.

     NewPassword New password. If ommitted a NULL password is applied.

Have fun 😉


Posted in Vista, Windows, Windows 7, Windows Vista, Windows XP and tagged , , , , by with comments disabled.