iTechtalk

Quick Search

Go Advanced

Member Login

Not registered? | Forgot Password
 
Register
Welcome
 
iTechtalk > Tutorials > Operating systems » Backing Up the Removable Storage Database In Windows XP
Reply
Old 12-05-2008, 10:17 AM   #1 (permalink)
 
Joseph's Avatar
 
Junior Member
Join Date: Nov 2008
Posts: 6
Smile Backing Up the Removable Storage Database In Windows XP

Backing Up the Removable Storage Database In Windows XP


This batch program creates a backup copy of the Removable Storage database. It illustrates some commonly used techniques, including stopping and starting services and using environment variables.

The following program is called Rsbackup.bat:

@echo off
rem Backs up the Removable Storage database
title Removable Storage Backup
echo Removable Storage database backup in process...

echo Stopping the Removable Storage service
net stop "removable storage" > nul

echo Copying the Removable Storage database
xcopy /y %systemroot%\system32\ntmsdata %systemroot%\system32\ntmsdata
\backup\ > nul

echo Starting the Removable Storage service
net start "removable storage" > nul

echo.
echo Removable Storage database was backed up to
echo %SystemRoot%\System32\NtmsData\Backup\
title Command Prompt


The first command to examine is Net Stop:

net stop "removable storage" > nul

The Net command is frequently included in batch programs because it can be used to control so many functions in Windows. In this case, we are stopping the Removable Storage service to ensure that it doesn’t have the database files open when we try to copy them. To stop or start a service, you can use the service’s “friendly name” (that is, the name that appears in the Services snap-in), as we’ve done here, or you can use the actual service name if you know it. (In the case of Removable Storage, the service name is Ntmssvc.) Throughout the program, Echo statements keep the user informed of the progress. Therefore, we use > Nul to redirect the output of the Net statement to the Nul device—colloquially known as the “bit bucket”— because its output is redundant.

The Xcopy command then makes a copy of the files:

xcopy /y %systemroot%\system32\ntmsdata systemroot%\system32\ntmsdata\

backup\ > nul


On mainly computers, the Removable Storage database files are stored in C:\Windows\ System32\Ntmsdata. Though, if you installed Windows in a different folder, the files will be in a different location. In this Xcopy statement, %SystemRoot% is an environment variable that states where Windows is installed on the local computer. By using environment variables, be sure that your batch programs work on any computer that is running Windows XP.
Joseph is offline   Reply With Quote
 
Reply

Bookmarks

Tags
backing up, removable, storage database, windows xp

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent installation of removable devices antaraagni Windows 7 0 04-18-2009 07:11 AM
Deny access to all removable storage classes (disks/drives) reader Windows 7 0 04-13-2009 06:56 AM
Scan e-mails and removable drives through Windows Defender valkyrie Windows 7 0 04-10-2009 09:20 AM
Changing name for devices with removable storage deep Windows Vista 0 03-10-2009 05:25 AM
Backing Up DFS in Windows Server 2008 Shagun Windows 2008 0 01-10-2009 06:06 AM


 

Content Relevant URLs by vBSEO 3.3.0