You may some times receive an error stating that
Registry Editor has been disabled by Administrator.
Task Manager has been disabled by Administrator.
Resolution for this is Add the below keys in to registry.
Save the below contents in a notepad file with .reg extension and run it.
----------------------------------------------------------------------------
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]"DisableTaskMgr"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]"DisableRegistryTools" =dword:00000000
----------------------------------------------------------------------------
or
Go to Start-->Run and type
For Registry Editor
REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableRegistryTools /t REG_DWORD /d 0 /f
For Task Manager
REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableTaskMgr /t REG_DWORD /d 0 /f
And it will be enabled.
Search this Blog
Thursday, April 30, 2009
Tuesday, April 21, 2009
Files & Settings TransferWizard
Moving files and settings to a new computer running Windows XP
You might want the high performance and powerful features of a new computer, but you don't want to give up the comfortable feeling of your old computer. You've arranged your desktop just the way you like, installed all your favorite programs, and organized your files so you can quickly find anything you need. Don't worry: If your new computer has Windows XP installed, you can use the Files and Settingss Transfer Wizard to copy everything from your old computer to your new computer.
Transfer files and settings across a network or cable
If you bought a new computer and can run it at the same time as your old computer, you can use a home network or a cable to transfer your files and settings. To use a home network, connect both your old and your new computers to the network at the same time. If you can't connect both computers to your home network, connect a null modem serial cable (available at most electronics stores) to the serial ports on both computers.
There are three phases to transferring files and settings between an old and a new computer using your network or a cable:
•
Prepare your new computer.
•
Run the Files and Settings Transfer Wizard on your old computer.
•
Complete the Files and Settings Transfer Wizard on your new computer.
Transfer files and settings using a shared folder or external hard disk drive
If you are reinstalling Windows XP on a single computer, or if you can't run your old and new computers at the same time, you can use the Files and Settings Transfer Wizard to store your information on an external hard disk drive or in a shared folder on your home network.
There are two phases to transferring files and settings between an old and a new computer using a shared folder or removable media:
•
Run the Files and Settings Transfer Wizard on your old computer to create a backup of your files and settings.
•
Run the Files and Settings Transfer Wizard on your new computer to restore your old documents to your new computer.
The entire process should take about an hour.
Transfer files and settings across a network or cable
Prepare your new computer
If you have a home network, connect both your old and new computers to the network. Then log on to your new computer as an administrator. After you have done that:
1.
Install any programs you use on your old computer.
2.
Click Start, point to All Programs, point to Accessories, point to System Tools, and then click Files and Settings Transfer Wizard.
You might want the high performance and powerful features of a new computer, but you don't want to give up the comfortable feeling of your old computer. You've arranged your desktop just the way you like, installed all your favorite programs, and organized your files so you can quickly find anything you need. Don't worry: If your new computer has Windows XP installed, you can use the Files and Settingss Transfer Wizard to copy everything from your old computer to your new computer.
Transfer files and settings across a network or cable
If you bought a new computer and can run it at the same time as your old computer, you can use a home network or a cable to transfer your files and settings. To use a home network, connect both your old and your new computers to the network at the same time. If you can't connect both computers to your home network, connect a null modem serial cable (available at most electronics stores) to the serial ports on both computers.
There are three phases to transferring files and settings between an old and a new computer using your network or a cable:
•
Prepare your new computer.
•
Run the Files and Settings Transfer Wizard on your old computer.
•
Complete the Files and Settings Transfer Wizard on your new computer.
Transfer files and settings using a shared folder or external hard disk drive
If you are reinstalling Windows XP on a single computer, or if you can't run your old and new computers at the same time, you can use the Files and Settings Transfer Wizard to store your information on an external hard disk drive or in a shared folder on your home network.
There are two phases to transferring files and settings between an old and a new computer using a shared folder or removable media:
•
Run the Files and Settings Transfer Wizard on your old computer to create a backup of your files and settings.
•
Run the Files and Settings Transfer Wizard on your new computer to restore your old documents to your new computer.
The entire process should take about an hour.
Transfer files and settings across a network or cable
Prepare your new computer
If you have a home network, connect both your old and new computers to the network. Then log on to your new computer as an administrator. After you have done that:
1.
Install any programs you use on your old computer.
2.
Click Start, point to All Programs, point to Accessories, point to System Tools, and then click Files and Settings Transfer Wizard.
3.
The Files and Settings Transfer Wizard appears. Click Next.
4.
On the Which computer is this? page, click New computer. Then, click Next.
5.
On the Do you have a Windows XP CD? page, you can create a Wizard Disk if you do not have the Windows XP CD available. If you have the Windows XP CD, click I will use the wizard from the Windows XP CD, click Next, and skip to the section Run the Files and Settings Transfer Wizard on your old computer. Otherwise, continue with the next step.
6.
Connect the removable media (such as an external hard disk drive, a USB flash drive, a memory card from your digital camera, or any removable media large enough to store your files and settings) to your computer. Click I want to create a Wizard Disk in the following drive. Select the removable media, and then click Next.
7.
When prompted, click the option that describes the operating system running on your old computer, and then click OK.
8.
When prompted to insert the removable media, click OK.
9.
The wizard displays the Now go to your old computer page. If you are transferring files across a network, skip to the section Run the Files and Settings Transfer Wizard on your old computer. If you are transferring files with a serial cable, click Next, and then continue with the next step.
10.
On the Where are the files and settings? page, click Direct cable, and then click Next.
11.
Connect your null modem serial cable to the serial ports on both your old and new computers. The serial ports are on the backs of the computers and have nine pins in two rows.
12.
On the Set up your serial connection page, click Autodetect. Leave the wizard on this page while you continue the process from your old computer.
Run the Files and Settings Transfer Wizard on your old computer
To continue the process on your old computer
1.
Close any open programs.
2.
Launch the Files and Settings Transfer Wizard. If you created a Wizard Disk, connect the Wizard Disk to your old computer. Click the Start menu, click My Computer, double-click the Wizard Disk to display its contents, and double-click FASTWiz. Then, skip to step 6. If you did not create a Wizard Disk and have your Windows XP CD instead, continue with the next step.
3.
Insert your Windows XP CD. If Windows XP Setup does not appear after 20 to 30 seconds, click the Start menu, click My Computer, right-click your CD drive, and then click AutoPlay.
4.
The Welcome to Microsoft Windows XP page appears. Click Perform additional tasks.
5.
Click Transfer files and settings.
6.
The Files and Settings Transfer Wizard appears. Click Next.
7.
On the Which computer is this? page, click Old computer. Then, click Next.
8.
If you are alerted that the firewall is blocking the program, click Unblock.
9.
The wizard displays the Select a transfer method page. If you are transferring files across a network, click Home or small office network, click Next, and then skip to step 12. If you are transferring files with a serial cable, continue with the next step.
10.
On the Select a transfer method page, click Direct cable. Then click Next.
11.
On the Set up your serial connection page, click Autodetect. Then, click Next.
12.
On the What do you want to transfer? page, click Next.
13.
If the Install programs on your new computer page appears, click Next.
14.
The wizard will examine your old computer, which may take about an hour. You do not need to be present during this time. When it is finished, the Password dialog box will appear on your new computer, displaying a case-sensitive password. Type this password in the Password dialog box on your old computer. Then, click OK.
15.
The wizard will transfer your files and settings, which may take an hour. You do not need to be present during this time. When the transfer is complete, click Finish on the old computer.
Complete the Files and Settings Transfer Wizard
To complete the transfer process on the new computer
1.
After the wizard transfers your files and settings, click Finish.
2.
When prompted, click Yes to log off. Then, log on again to access your newly transferred files and settings.
You are done transferring your files and settings, and can use your new computer. You should shut down your old computer, but keep it available for at least two weeks in case you discover a file that was not transferred.
Transfer files and settings using a shared folder or external hard disk drive
Run the Files and Settings Transfer Wizard on your old computer
To run the Files and Settings Transfer Wizard on your old computer
1.
Log on to your old computer.
2.
Close any open programs.
3.
Insert your Windows XP CD into your CD drive. If Windows XP Setup does not appear within 20 to 30 seconds, click the Start menu, click My Computer, right-click your CD drive, and then click AutoPlay.
4.
The Welcome to Microsoft Windows XP page appears. Click Perform additional tasks.
5.
Click Transfer files and settings.
6.
The Files and Settings Transfer Wizard appears. Click Next.
7.
On the Which computer is this? page, click Old computer. Then, click Next.
8.
If you are alerted that the firewall is blocking the program, click Unblock.
9.
Connect the removable media (such as an external hard disk drive, a USB flash drive, a memory card from your digital camera, or any removable media large enough to store your files and settings) to your computer. On the Select a transfer method page, click Other. Click the Browse button to select your removable media, and then click OK. Click Next.
10.
On the What do you want to transfer? page, click Next.
11.
The wizard will back up your files and settings, which may take an hour. You do not need to be present during this time. When the backup is complete, click Finish.
Now you can safely reinstall Windows XP. Then, continue the transfer process on the new computer.
Run the Files and Settings Transfer Wizard on your new computer
To run the Files and Setting Transfer Wizard on your new computer
1.
Log on to your new computer as an administrator.
2.
Install any programs that you used on your old computer.
3.
Click Start, point to All Programs, point to Accessories, point to System Tools, and then click Files and Settings Transfer Wizard.
4.
The Files and Settings Transfer Wizard appears. Click Next.
5.
On the Which computer is this? page, click New computer. Then, click Next.
6.
On the Do you have a Windows XP CD? page, click I don't need the Wizard Disk. Then, click Next.
7.
Connect the removable media to your computer. On the Where are the files and settings? page, click Other. Click the Browse button to select your removable media, and then click OK. Click Next.
8.
After the wizard transfers your files and settings, click Finish.
9.
When prompted, click Yes to log off. Then, log on again to access your newly transferred files and settings.
You are done transferring your files and settings, and can use your new computer.
Tuesday, April 07, 2009
About DLLs
On Microsoft Window's operating systems, a DLL stands for Dynamic Link Library.
DLL's are relatively small files that include a library of functions- usually data that can be
shared across multiple applications. DLL's are called upon by various applications and
can be loaded and utilized by these applications concurrently.
Registering a DLL
There are two easy ways that a DLL can be registered in your Window's operating
system's registry, the first is the simplest, known as self registering files, the second way
is to manually register a DLL.
Self Registering Files
It should be noted that many DLL files are self registering, they include information
required to store themselves in the operating system's registry. As the name states, self
registering files require no human intervention. Self registering files will automatically
store themselves on your machine and become accessible when needed. Besides DLL
files, other types of files that are sometimes self registering include .EXE and .OCX.
Manually Register Files
The second method used to register DLL files on your computer is via manual
registration. Manually registering a DLL file is quite simple and can be done in only a
few steps.
1. The first step is turn on your computer, launching your Window's operating
system.
2. Once your Window's operating system has loaded completely, click on Start and
then click on Run.
3. In the third step, you will input in the Run field a command that tells your
computer to register the DLL file. You will need to input specific information
including the path and the file name. The following is a template for the
command: regsvr32 "\FileName.dll"
It is important to note that path is the actually location or directory of where the
file is located. Filename is obviously the name of the DLL file you will be
registering. Below is a sample command:
Regsvr32 "C:\Windows\System32\example.dll"
4. Once the command is input into the Run field correctly, press Enter.
5. Once the DLL has been registered, you should receive a confirmation in the form
of a pop up box. This message will list your newly registered DLL file and
confirm that is was successfully registered into the registry.
Unregistering a DLL
For Unregistering the DLLs use the same procedure with the additional option of /u.
DLL's are relatively small files that include a library of functions- usually data that can be
shared across multiple applications. DLL's are called upon by various applications and
can be loaded and utilized by these applications concurrently.
Registering a DLL
There are two easy ways that a DLL can be registered in your Window's operating
system's registry, the first is the simplest, known as self registering files, the second way
is to manually register a DLL.
Self Registering Files
It should be noted that many DLL files are self registering, they include information
required to store themselves in the operating system's registry. As the name states, self
registering files require no human intervention. Self registering files will automatically
store themselves on your machine and become accessible when needed. Besides DLL
files, other types of files that are sometimes self registering include .EXE and .OCX.
Manually Register Files
The second method used to register DLL files on your computer is via manual
registration. Manually registering a DLL file is quite simple and can be done in only a
few steps.
1. The first step is turn on your computer, launching your Window's operating
system.
2. Once your Window's operating system has loaded completely, click on Start and
then click on Run.
3. In the third step, you will input in the Run field a command that tells your
computer to register the DLL file. You will need to input specific information
including the path and the file name. The following is a template for the
command: regsvr32 "\FileName.dll"
It is important to note that path is the actually location or directory of where the
file is located. Filename is obviously the name of the DLL file you will be
registering. Below is a sample command:
Regsvr32 "C:\Windows\System32\example.dll"
4. Once the command is input into the Run field correctly, press Enter.
5. Once the DLL has been registered, you should receive a confirmation in the form
of a pop up box. This message will list your newly registered DLL file and
confirm that is was successfully registered into the registry.
Unregistering a DLL
For Unregistering the DLLs use the same procedure with the additional option of /u.
Monday, April 06, 2009
McAfee's SuperDAT
McAfee sdat extract and scan for anti virus in safe mode. You can use McAfee Sdat to scan your computer for virus. Here are step to perform sdat scan:
1. Download the latest sdat from McAfee site
2. Extract sdat to forder say C:\Scan using this commandsdatXXX.exe /E
Where XXX is number of Sdat file. This is extract file like Scan.exe, McTool.exe, clean.dat etc
3. Run this command :Scan.exe /ADL /CLEAN /DEL /HTML C:\Scan\Report.html.Above command will scan all local drives (ADL), try to clean infected files (CLEAN), delete file if clean fail (DEL) and make html report (HTML).For more Scan.exe option try /? help. Below is the output of
C:\sdat>Scan.exe /?
McAfee VirusScan for Win32 v5.20.0Copyright (c) 1992-2007 McAfee, Inc. All rights reserved.(408) 988-3832 LICENSED COPY - Jun 5 2007
Scan engine v5.2.00 for Win32.Virus data file v5267 created Apr 04 2008Scanning for 386611 viruses, trojans and variants.
Usage: Scan [object1] [object2...] [option1] [option2...]
/? Display this help screen.
/AD Scan all drives (not removable media).
/ADL Scan all local drives (not removable media).
/ADN Scan all network drives.
/AFC= Set the Size of the Internal Cache Used When Decompressing Archive Files.
/ALL Scan all files regardless of filename extension.
C:\sdat>Scan.exe /?
McAfee VirusScan for Win32 v5.20.0Copyright (c) 1992-2007 McAfee, Inc. All rights reserved.(408) 988-3832 LICENSED COPY - Jun 5 2007
Scan engine v5.2.00 for Win32.Virus data file v5267 created Apr 04 2008Scanning for 386611 viruses, trojans and variants.
Usage: Scan [object1] [object2...] [option1] [option2...]
/? Display this help screen.
/AD Scan all drives (not removable media).
/ADL Scan all local drives (not removable media).
/ADN Scan all network drives.
/AFC= Set the Size of the Internal Cache Used When Decompressing Archive Files.
/ALL Scan all files regardless of filename extension.
/ALLOLE Treat all files as compound/OLE regardless of extension.
/ANALYZE Turn on heuristic analysis for programs and macros.
/APPEND Append to report file rather than overwriting.
/BOOT Scan boot sector and master boot record only.
/CHECKLIST Scan list of files contained in .
/CLEAN Clean viruses from infected files and system areas.
/CONTACTFILE Display contents of when a virus is found.
/DAM Remove all macros from infected MS Office files.
/DEL Delete infected files./DOHSM Scan migrated files (hierarchical storage management).
/EXCLUDE Do not scan files listed in .
/EXTLIST List file extensions scanned by default.
/EXTRA Scan using an extra DAT file.
/FAM Find all macros - not just infected macros.
Used with /DAM will remove all macros.
/FREQUENCY Do not scan after the previous scan.
/HELP Display this help screen.
/HTML Create an HTML report file.
/LOAD Load options from .
/MAILBOX Scan inside plain text mailboxes.
/MANALYZE Turn on macro heuristics.
/MANY Scan many floppy diskettes.
/MIME Scan inside MIME, UUE, XXE and BinHex files.
/MOVE Move infected files into directory , preservingpath.
/NOBACKUP Do not prompt for a backup diskette during a sectorrepair.
/NOBOOT Do not scan boot sectors.
/NOBREAK Disable Ctrl-C / Ctrl-Break during scanning.
/NOCOMP Do not scan self extracting executables by default.
/NOD Don't switch into /ALL mode when repairing.
/NODDA No direct disk access.
/NODOC Do not scan MS Office files.
/NOEXPIRE Disable data files expiration date notice.
/NOMEM Do not scan memory for viruses.
/NODECRYPT Don't scan password-protected MS Office documents.
/NOJOKES Do not alert on joke files.
/NORENAME Do not rename infected files that cannot be cleaned.
/PANALYZE Turn on program heuristics./PAUSE Pause at end of each screen page.
/PLAD Preserve Last Access Dates on Novell NetWare drives.
/PROGRAM Scan for potentially unwanted applications.
/REPORT Report names of viruses found into .
/RPTALL Include all scanned files in the /REPORT file.
/RPTCOR Include corrupted files in /REPORT file./
RPTERR Include errors in /REPORT file.
/SILENT Disable all screen output.
/STREAMS Scan inside NTFS streams (NT only).
/SUB Scan subdirectories.
/TIMEOUT Set the maximum time to spend scanning any one file.
/UNZIP Scan inside archive files.
/VIRLIST Display virus list.
/WINMEM Scan all Running Windows Processes.
/WINMEM= Scan the Running Windows Process With Process ID .
Sunday, April 05, 2009
About Batch Files
Batch File Programming
Batch File Commands
@
%DIGIT
%VARIABLE%
CALL
CLS
ECHO
FOR
GOTO
IF
PAUSE
REM
SET
SHIFT
Miscellaneous
@
In DOS version 3.3 and later, hides the echo of a batch command. Any output generated by the command is echoed. The at-sign can be prefixed to any DOS command, program name, or batch file name within a batch file.
@[command]
examples
@
{Seperates sections of the batch file without diplaying the DOS prompt.}
@echo OFF
{Hides the echo off report.}
%DIGIT
Replaceable batch parameters which are defined by the user when the batch is executed. The parameters are separated by spaces, commas, or semicolons.
%digit
{Digit: any digit from 0 to 9. %0 has the value of the batch command as it appears on the command line when the batch is executed. %1 represents the first string typed after the batch commmand. Each occurrence of %digit is replaced by the corresponding string from the batch command line.}
examples
MYBATCH DOC A:COPY *.%1 %2
{Copies all .DOC files in the default directory to drive A:}
%VARIABLE%
Replaces the DOS environment variable name with its environment value.
%variable%
{Variable: a string of uppercase characers in the environment associated with a string value. Variable is created in the environment by using SET.}
examples
%PATH%
{Returns the value of PATH, the current search path, which is executable.}
echo %PATH%
{Displays the value of PATH, the current search path.}
%PROMPT%
{Returns the value of PROMPT, the current prompt string, which is executable.}
echo %PROMPT%
{Displays the value of PROMPT, the current prompt string.}
echo The current search path is: %PATH%
{Displays the message including the current search path.}
set USER=Johnif %USER%= =John goto LABEL
{Since the value of USER does equal "John", the control is transferred to the label, LABEL.}
CALL
Loads and executes a batch file from within a batch file as if it were a external command. When a second batch file completes, control is returned to the calling file.
call [drive:][path]filename [batch-parameters]Before DOS version 3.3:command /c [drive:][path]filename [batch-parameters]
CLS
Clears the video display screen, setting the cursor in the upper left-hand corner.
cls
ECHO
Controls whether commands and comments within a batch file are displayed.
echo [ONOFFmessage.]
examples
echo
{Displays echo status}
echo ON
{Restores normal display activity.}
echo OFF
{Halts display of DOS prompt and commands.}
echo Processing...
{Displays "Processing..." on the screen.}
echo %USER%
{Displays the value of USER on the screen.}
echo.
{Displays a single blank line on the screen.}
echo ^L > prn
{Sends an ASCII control-code (form feed) to the printer. Press plus to type the ^L character.}
echo YDel *.*
{Answers the DEL "Are you sure" question automatically.}
FOR
Repeats the operation of a DOS command for each member of a list. Use CALL to execute a batch file as a command.
for %%argument in (list) do command
{Argument: any letter from A to Z. List: a sequence of strings separated by spaces or commas. Wildcards are allowed.}
examples
for %%d in (A,C,D) do DIR %%d *.*
{Displays the directories of drives A, C, and D sequentially.}
for %%f in (*.TXT *.BAT *.DOC) do TYPE %%f
{Types the contents of all .TXT, .BAT, and .DOC files in the current default directory.}
for %%P in (%PATH%) do if exist %%P\*.BAT COPY %%P\*.BAT C:\BAT
{Copies all batch files which exist in any directory on the DOS command search path into the directory C:\BAT.}
for %%f in (*.PAS) do call compile %%f
{Compiles all .PAS files in the current default directory.}
GOTO
Transfers control within a batch file to a line identified by a label. The label must be of the form ":LABEL".
goto LABEL:LABEL
IF
Tests a condition and executes a command only if the condition is TRUE. But if the NOT modifier is present, the command will be executed only if the condition is FALSE.
if [not] condition command
{Condition: errorlevel number; string1= =string2; or exist filename. Command: any DOS command, batch command, batch file name, or program name.}
examples
if [not] errorlevel number command
{Errorlevel: an exit code returned by a program or an external command. The following DOS commands return an exit code: BACKUP, RESTORE, FORMAT, REPLACE, and XCOPY. Number: a numerical value (integer) against which the exit code is compared. The condition is TRUE if the exit code returned by the previous program is greater than or equal to number. The condition is FALSE if the exit code is less than number.}
BACKUP C:\*.* A: /sif errorlevel 3 goto TROUBLE
{If the BACKUP command exits with a code of 3 or higher, control will be transferred to the label TROUBLE.}
if errorlevel 3 if not errorlevel 4 echo ERROR #3 occurredif errorlevel 4 if not errorlevel 5 echo ERROR #4 occurred
{Nested if statements that determine the exact error number.}
if [not] string1= =string2 command
{The condition is TRUE if both strings are identical. The comparison is case sensitive. If either string is blank, a syntax error occurs.}
if (%1)= =(LTRS) CD C:\WORD\LTRS
{If the first parameter is LTRS, the change directory to LTRS.}
if "%1"= ="" goto ERROR
{If there is no parameter, then control is transferred to label ERROR.}
if not %2X= =X DIR %2\*.*
{If there is a second parameter, then display all the files contained in the directory %2.}
if not "%3"= ="" if not "%3"= ="b" if not "%3"= ="B" goto BADPARAM
{If there is no third parameter or if it is anything other than b or B, then go to label BADPARAM.}
if [not] exist filename command
{The condition is TRUE if filename can be located. The filename can include drive and path specifications. Wildcards are allowed.}
if exist D:\%1\nul CD %1
{Tests for the existence of directory %1 even if it contains no files, then changes to that directory if it exists.}
if not exist A:\FLASH.EXE COPY C:\PROJECTS\FLASH.EXE A:
{Copies FLASH.EXE to drive A, but only if it doesn't exit there already.}
PAUSE
Pauses the running of a batch file and displays the message "Press any key to continue ..." on the screen. If the optional message is included, it will be displayed first. Use pause to optionally terminate the batch file with at a safe place. The optional message is not displayed when echo is OFF, so the message must be echoed on the preceding line.
pause [message]
examples
pause
{Displays "Press any key to continue ...".}
pause < nul
{Waits with no comment.}
pause Do you want to continue?
{Displays "Do you want to continue?" with "Press any key to continue ..." on the next line.}
REM
Adds remarks to a batch file.
rem [remark]
examples
@rem
{Hides the remark from display.}
SET
Set will view the DOS environment or create, change, or delete environment values.
set [variable=[value]]
{Variable: a string of characters, unbroken by spaces, which are converted to uppercase letters in the environment. Value: a string of characters, case specific, associated with variable.}
examples
set
{Display the entire DOS environment.}
set USER=John
{Sets the value of USER to the string, "John".}
set USER=
{Removes USER from the environment.}
set PATH=C:\;C:\DOS
{Sets C:\;C:\DOS as the current search path.}
set PATH=%PATH%;C:\TEST
{Appends ;C:\TEST to the current search path.}
SHIFT
Shifts any parameter on the command line one position to the left. Use SHIFT to refer to multiple parameters by one name or to use more than ten parameters on a single command line.
shift
examples
:LOOPCOPY %1 A:shiftif not (%1)==() goto LOOP
{Beginning with the first parameter, all the parameters listed on the command line are iterated and a file, the value of the parameter, is copied to A:.}
Miscellaneous
command > nul
{Redirects command output to oblivion.}
command > file
{Redirects command output to file.}
command >> file
{Appends command output to file.}
command < file
{Redirects file output to command.}
PATH
{Displays "PATH=" followed by the value of PATH, the current search path.}
PATH directories
{Sets directories as the current search path.}
PATH = directories
{Sets directories as the current search path.}
PATH;
{Disables extended command searching and confines the searching to the default directory.}
PROMPT
{Resets the prompt string to its default, $n$g.}
CD
{Displays the current directory and its path.}
.
{Represents the default directory (If PATH=D:\;C:\SYS;C:. then current directory will be searched after D: and C:\SYS).}
..
{Represents the parent of the default directory (C:\TOOLS\WP\LTRS.DOC is the same as ..\WP\LTRS.DOC).}
%%
{A literal "%".}
Batch File Commands
@
%DIGIT
%VARIABLE%
CALL
CLS
ECHO
FOR
GOTO
IF
PAUSE
REM
SET
SHIFT
Miscellaneous
@
In DOS version 3.3 and later, hides the echo of a batch command. Any output generated by the command is echoed. The at-sign can be prefixed to any DOS command, program name, or batch file name within a batch file.
@[command]
examples
@
{Seperates sections of the batch file without diplaying the DOS prompt.}
@echo OFF
{Hides the echo off report.}
%DIGIT
Replaceable batch parameters which are defined by the user when the batch is executed. The parameters are separated by spaces, commas, or semicolons.
%digit
{Digit: any digit from 0 to 9. %0 has the value of the batch command as it appears on the command line when the batch is executed. %1 represents the first string typed after the batch commmand. Each occurrence of %digit is replaced by the corresponding string from the batch command line.}
examples
MYBATCH DOC A:COPY *.%1 %2
{Copies all .DOC files in the default directory to drive A:}
%VARIABLE%
Replaces the DOS environment variable name with its environment value.
%variable%
{Variable: a string of uppercase characers in the environment associated with a string value. Variable is created in the environment by using SET.}
examples
%PATH%
{Returns the value of PATH, the current search path, which is executable.}
echo %PATH%
{Displays the value of PATH, the current search path.}
%PROMPT%
{Returns the value of PROMPT, the current prompt string, which is executable.}
echo %PROMPT%
{Displays the value of PROMPT, the current prompt string.}
echo The current search path is: %PATH%
{Displays the message including the current search path.}
set USER=Johnif %USER%= =John goto LABEL
{Since the value of USER does equal "John", the control is transferred to the label, LABEL.}
CALL
Loads and executes a batch file from within a batch file as if it were a external command. When a second batch file completes, control is returned to the calling file.
call [drive:][path]filename [batch-parameters]Before DOS version 3.3:command /c [drive:][path]filename [batch-parameters]
CLS
Clears the video display screen, setting the cursor in the upper left-hand corner.
cls
ECHO
Controls whether commands and comments within a batch file are displayed.
echo [ONOFFmessage.]
examples
echo
{Displays echo status}
echo ON
{Restores normal display activity.}
echo OFF
{Halts display of DOS prompt and commands.}
echo Processing...
{Displays "Processing..." on the screen.}
echo %USER%
{Displays the value of USER on the screen.}
echo.
{Displays a single blank line on the screen.}
echo ^L > prn
{Sends an ASCII control-code (form feed) to the printer. Press
echo YDel *.*
{Answers the DEL "Are you sure" question automatically.}
FOR
Repeats the operation of a DOS command for each member of a list. Use CALL to execute a batch file as a command.
for %%argument in (list) do command
{Argument: any letter from A to Z. List: a sequence of strings separated by spaces or commas. Wildcards are allowed.}
examples
for %%d in (A,C,D) do DIR %%d *.*
{Displays the directories of drives A, C, and D sequentially.}
for %%f in (*.TXT *.BAT *.DOC) do TYPE %%f
{Types the contents of all .TXT, .BAT, and .DOC files in the current default directory.}
for %%P in (%PATH%) do if exist %%P\*.BAT COPY %%P\*.BAT C:\BAT
{Copies all batch files which exist in any directory on the DOS command search path into the directory C:\BAT.}
for %%f in (*.PAS) do call compile %%f
{Compiles all .PAS files in the current default directory.}
GOTO
Transfers control within a batch file to a line identified by a label. The label must be of the form ":LABEL".
goto LABEL:LABEL
IF
Tests a condition and executes a command only if the condition is TRUE. But if the NOT modifier is present, the command will be executed only if the condition is FALSE.
if [not] condition command
{Condition: errorlevel number; string1= =string2; or exist filename. Command: any DOS command, batch command, batch file name, or program name.}
examples
if [not] errorlevel number command
{Errorlevel: an exit code returned by a program or an external command. The following DOS commands return an exit code: BACKUP, RESTORE, FORMAT, REPLACE, and XCOPY. Number: a numerical value (integer) against which the exit code is compared. The condition is TRUE if the exit code returned by the previous program is greater than or equal to number. The condition is FALSE if the exit code is less than number.}
BACKUP C:\*.* A: /sif errorlevel 3 goto TROUBLE
{If the BACKUP command exits with a code of 3 or higher, control will be transferred to the label TROUBLE.}
if errorlevel 3 if not errorlevel 4 echo ERROR #3 occurredif errorlevel 4 if not errorlevel 5 echo ERROR #4 occurred
{Nested if statements that determine the exact error number.}
if [not] string1= =string2 command
{The condition is TRUE if both strings are identical. The comparison is case sensitive. If either string is blank, a syntax error occurs.}
if (%1)= =(LTRS) CD C:\WORD\LTRS
{If the first parameter is LTRS, the change directory to LTRS.}
if "%1"= ="" goto ERROR
{If there is no parameter, then control is transferred to label ERROR.}
if not %2X= =X DIR %2\*.*
{If there is a second parameter, then display all the files contained in the directory %2.}
if not "%3"= ="" if not "%3"= ="b" if not "%3"= ="B" goto BADPARAM
{If there is no third parameter or if it is anything other than b or B, then go to label BADPARAM.}
if [not] exist filename command
{The condition is TRUE if filename can be located. The filename can include drive and path specifications. Wildcards are allowed.}
if exist D:\%1\nul CD %1
{Tests for the existence of directory %1 even if it contains no files, then changes to that directory if it exists.}
if not exist A:\FLASH.EXE COPY C:\PROJECTS\FLASH.EXE A:
{Copies FLASH.EXE to drive A, but only if it doesn't exit there already.}
PAUSE
Pauses the running of a batch file and displays the message "Press any key to continue ..." on the screen. If the optional message is included, it will be displayed first. Use pause to optionally terminate the batch file with
pause [message]
examples
pause
{Displays "Press any key to continue ...".}
pause < nul
{Waits with no comment.}
pause Do you want to continue?
{Displays "Do you want to continue?" with "Press any key to continue ..." on the next line.}
REM
Adds remarks to a batch file.
rem [remark]
examples
@rem
{Hides the remark from display.}
SET
Set will view the DOS environment or create, change, or delete environment values.
set [variable=[value]]
{Variable: a string of characters, unbroken by spaces, which are converted to uppercase letters in the environment. Value: a string of characters, case specific, associated with variable.}
examples
set
{Display the entire DOS environment.}
set USER=John
{Sets the value of USER to the string, "John".}
set USER=
{Removes USER from the environment.}
set PATH=C:\;C:\DOS
{Sets C:\;C:\DOS as the current search path.}
set PATH=%PATH%;C:\TEST
{Appends ;C:\TEST to the current search path.}
SHIFT
Shifts any parameter on the command line one position to the left. Use SHIFT to refer to multiple parameters by one name or to use more than ten parameters on a single command line.
shift
examples
:LOOPCOPY %1 A:shiftif not (%1)==() goto LOOP
{Beginning with the first parameter, all the parameters listed on the command line are iterated and a file, the value of the parameter, is copied to A:.}
Miscellaneous
command > nul
{Redirects command output to oblivion.}
command > file
{Redirects command output to file.}
command >> file
{Appends command output to file.}
command < file
{Redirects file output to command.}
PATH
{Displays "PATH=" followed by the value of PATH, the current search path.}
PATH directories
{Sets directories as the current search path.}
PATH = directories
{Sets directories as the current search path.}
PATH;
{Disables extended command searching and confines the searching to the default directory.}
PROMPT
{Resets the prompt string to its default, $n$g.}
CD
{Displays the current directory and its path.}
.
{Represents the default directory (If PATH=D:\;C:\SYS;C:. then current directory will be searched after D: and C:\SYS).}
..
{Represents the parent of the default directory (C:\TOOLS\WP\LTRS.DOC is the same as ..\WP\LTRS.DOC).}
%%
{A literal "%".}
Subscribe to:
Posts (Atom)