Google
 

The ATTRIB Commnd - CMD


Attrib commnd - Changes file attributes for a single file or directory. This command sets or removes the read-only, system, hidden, and compressed attributes assigned to files or directories.

The attrib commnd with the parameters listed below is only available when you are using the Recovery Console. The attrib command with different parameters is available from the command prompt.

attrib [+r|-r] [+s|-s] [+h|-h] [+c|-c] [[drive:][path] filename]

Parameters

+r

Sets the read-only file attribute.

-r

Clears the read-only file attribute.

+s

Sets the system file attribute.

-s

Clears the system file attribute.

+h

Sets the hidden file attribute.

-h

Clears the hidden file attribute.

+c

Sets the compressed file attribute.

-c

Clears the compressed file attribute.

[[drive:][path] filename]

Specifies the location and name of the directory or file you want to process. You can change attributes for only one file or directory at a time.

AT CMD Commnd


AT - Schedules commands and programs to run on a computer at a specified time and date. You can use at only when the Schedule service is running. Used without parameters, at lists scheduled commands.

Syntax
at [\\ComputerName] [{[ID] [/delete] | /delete [/yes]}]

at [[\\ComputerName] Hours:Minutes [/interactive] [{/every:Date[,…] | /next:Date[,…]}] Command]

Parameters

\\ComputerName
Specifies a remote computer. If you omit this parameter, at schedules the commands and programs on the local computer.
ID
Specifies the identification number assigned to a scheduled command.
/delete
Cancels a scheduled command. If you omit ID, all of the scheduled commands on the computer are canceled.
/yes
Answers yes to all queries from the system when you delete scheduled events.
Hours:Minutes
Specifies the time when you want to run the command. Time is expressed as Hours:Minutes in 24-hour notation (that is, 00:00 [midnight] through 23:59).
/interactive
Allows Command to interact with the desktop of the user who is logged on at the time Command runs.
/every:
Runs Command on every specified day or days of the week or month (for example, every Thursday, or the third day of every month).
Date
Specifies the date when you want to run the command. You can specify one or more days of the week (that is, type M,T,W,Th,F,S,Su) or one or more days of the month (that is, type 1 through 31). Separate multiple date entries with commas. If you omit Date, at uses the current day of the month.
/next:
Runs Command on the next occurrence of the day (for example, next Thursday).
Command
Specifies the Windows command, program (that is, .exe or .com file), or batch program (that is, .bat or .cmd file) that you want to run. When the command requires a path as an argument, use the absolute path (that is, the entire path beginning with the drive letter). If the command is on a remote computer, specify Universal Naming Convention (UNC) notation for the server and share name, rather than a remote drive letter.
/?
Displays help at the command prompt.
Remarks
Schtasks is another command-line scheduling tool that you can use to create and manage scheduled tasks. For more information about schtasks, see Related Topics.

Using at
To use at, you must be a member of the local Administrators group.

Loading Cmd.exe
At does not automatically load Cmd.exe, the command interpreter, before running commands. If you are not running an executable (.exe) file, you must explicitly load Cmd.exe at the beginning of the command as follows:

cmd /c dir > c:\test.out

Viewing scheduled commands
When you use at without command-line options, scheduled tasks appear in a table formatted similar to the following:

Status ID Day Time Command Line
OK 1 Each F 4:30 PM net send group leads status due
OK 2 Each M 12:00 AM chkstor > check.file
OK 3 Each F 11:59 PM backup2.bat

Including identification number (ID)
When you include identification number (ID) with at at a command prompt, information for a single entry appears in a format similar to the following:

Task ID: 1

Status: OK

Schedule: Each F

Time of Day: 4:30 PM

Command: net send group leads status due
After you schedule a command with at, especially a command that has command-line options, check that the command syntax is correct by typing at without command-line options. If the information in the Command Line column is incorrect, delete the command and retype it. If it is still incorrect, retype the command with fewer command-line options.

Viewing results
Commands scheduled with at run as background processes. Output is not displayed on the computer screen. To redirect output to a file, use the redirection symbol (>). If you redirect output to a file, you need to use the escape symbol (^) before the redirection symbol, whether you are using at at the command line or in a batch file. For example, to redirect output to Output.text, type:

at 14:45 c:\test.bat ^>c:\output.txt

The current directory for the executing command is the systemroot folder.

Changing system time
If you change the system time at a computer after you schedule a command to run with at, synchronize the at scheduler with the revised system time by typing at without command-line options.

Storing commands
Scheduled commands are stored in the registry. As a result, you do not lose scheduled tasks if you restart the Schedule service.

Connecting to network drives
Do not use a redirected drive for scheduled jobs that access the network. The Schedule service might not be able to access the redirected drive, or the redirected drive might not be present if a different user is logged on at the time the scheduled task runs. Instead, use UNC paths for scheduled jobs. For example:

at 1:00pm my_backup \\server\share

Do not use the following syntax, where x: is a connection made by the user:

at 1:00pm my_backup x:

If you schedule an at command that uses a drive letter to connect to a shared directory, include an at command to disconnect the drive when you are finished using the drive. If the drive is not disconnected, the assigned drive letter is not available at the command prompt.

Tasks stopping after 72 hours
By default, tasks scheduled using the at command stop after 72 hours. You can modify the registry to change this default value.

Start Registry Editor (regedit.exe).
Locate and click the following key in the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Schedule
On the Edit menu, click Add Value, and then add the following registry value: Value Name: AtTaskMaxHours Data type: REG_DWORD Radix: Decimal Value Data: 0. A value of 0 in the value data field indicates no limit, does not stop. Values from 1 through 99 indicates the number of hours.
Caution

Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer.
Task Scheduler and the at command
You can use the Scheduled Tasks folder to view or modify the settings of a task that was created by using the at command. When you schedule a task using the at command, the task is listed in the Scheduled Tasks folder, with a name such as the following:At3478. However, if you modify an at task through the Scheduled Tasks folder, it is upgraded to a normal scheduled task. The task is no longer visible to the at command, and the at account setting no longer applies to it. You must explicitly enter a user account and password for the task.

Examples
To display a list of commands scheduled on the Marketing server, type:

at \\marketing
To learn more about a command with the identification number 3 on the Corp server, type:

at \\corp 3
To schedule a net share command to run on the Corp server at 8:00 A.M. and redirect the listing to the Maintenance server, in the Reports shared directory, and the Corp.txt file, type:

at \\corp 08:00 cmd /c “net share reports=d:\marketing\reports >> \\maintenance\reports\corp.txt”
To back up the hard drive of the Marketing server to a tape drive at midnight every five days, create a batch program called Archive.cmd, which contains the backup commands, and then schedule the batch program to run, type:

at \\marketing 00:00 /every:5,10,15,20,25,30 archive
To cancel all commands scheduled on the current server, clear the at schedule information as follows:

at /delete
To run a command that is not an executable (that is, .exe) file, precede the command with cmd /c to load Cmd.exe as follows:

cmd /c dir > c:\test.out

ASSOC CMD Commnd


Displays or modifies file extension associations

ASSOC [.ext[=[fileType]]]

.ext Specifies the file extension to associate the file type with
fileType Specifies the file type to associate with the file extension

Type ASSOC without parameters to display the current file associations.
If ASSOC is invoked with just a file extension, it displays the current
file association for that file extension. Specify nothing for the file
type and the command will delete the association for the file extension.

Syntax
ASSOC .ext = [fileType]
ASSOC
ASSOC .ext
ASSOC .ext =

Key
.ext : The file extension
fileType : The type of file

CMD Commnds - Commands


CMD, or CMD.EXE, is the command line shell introduced in Windows NT and available in all the below versions of Microsoft Windows.

Windows NT

Windows XP

Windows 2000

Windows 2003

Here are the commnds useable in CMD interpreter:

ASSOC Displays or modifies file extension associations.
AT Schedules commands and programs to run on a computer.
ATTRIB Displays or changes file attributes.
BREAK Sets or clears extended CTRL+C checking.
CACLS Displays or modifies access control lists (ACLs) of files.
CALL Calls one batch program from another.
CD Displays the name of or changes the current directory.
CHCP Displays or sets the active code page number.
CHDIR Displays the name of or changes the current directory.
CHKDSK Checks a disk and displays a status report.
CHKNTFS Displays or modifies the checking of disk at boot time.
CLS Clears the screen.
CMD Starts a new instance of the Windows command interpreter.
COLOR Sets the default console foreground and background colors.
COMP Compares the contents of two files or sets of files.
COMPACT Displays or alters the compression of files on NTFS partitions.
CONVERT Converts FAT volumes to NTFS. You cannot convert the
current drive.
COPY Copies one or more files to another location.
DATE Displays or sets the date.
DEL Deletes one or more files.
DIR Displays a list of files and subdirectories in a directory.
DISKCOMP Compares the contents of two floppy disks.
DISKCOPY Copies the contents of one floppy disk to another.
DOSKEY Edits command lines, recalls Windows commands, and creates macros.
ECHO Displays messages, or turns command echoing on or off.
ENDLOCAL Ends localization of environment changes in a batch file.
ERASE Deletes one or more files.
EXIT Quits the CMD.EXE program (command interpreter).
FC Compares two files or sets of files, and displays the differences
between them.
FIND Searches for a text string in a file or files.
FINDSTR Searches for strings in files.
FOR Runs a specified command for each file in a set of files.
FORMAT Formats a disk for use with Windows.
FTYPE Displays or modifies file types used in file extension associations.
GOTO Directs the Windows command interpreter to a labeled line in a
batch program.
GRAFTABL Enables Windows to display an extended character set in graphics
mode.
HELP Provides Help information for Windows commands.
IF Performs conditional processing in batch programs.
LABEL Creates, changes, or deletes the volume label of a disk.
MD Creates a directory.
MKDIR Creates a directory.
MODE Configures a system device.
MORE Displays output one screen at a time.
MOVE Moves one or more files from one directory to another directory.
PATH Displays or sets a search path for executable files.
PAUSE Suspends processing of a batch file and displays a message.
POPD Restores the previous value of the current directory saved by PUSHD.
PRINT Prints a text file.
PROMPT Changes the Windows command prompt.
PUSHD Saves the current directory then changes it.
RD Removes a directory.
RECOVER Recovers readable information from a bad or defective disk.
REM Records comments (remarks) in batch files or CONFIG.SYS.
REN Renames a file or files.
RENAME Renames a file or files.
REPLACE Replaces files.
RMDIR Removes a directory.
SET Displays, sets, or removes Windows environment variables.
SETLOCAL Begins localization of environment changes in a batch file.
SHIFT Shifts the position of replaceable parameters in batch files.
SORT Sorts input.
START Starts a separate window to run a specified program or command.
SUBST Associates a path with a drive letter.
TIME Displays or sets the system time.
TITLE Sets the window title for a CMD.EXE session.
TREE Graphically displays the directory structure of a drive or path.
TYPE Displays the contents of a text file.
VER Displays the Windows version.
VERIFY Tells Windows whether to verify that your files are written
correctly to a disk.
VOL Displays a disk volume label and serial number.
XCOPY Copies files and directory trees.

Microsoft DOS CMD and Command.com


Starts a new instance of the Windows XP command interpreter

CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF]
[[/S] [/C | /K] string]

/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains
/S Modifies the treatment of string after /C or /K (see below)
/Q Turns echo off
/D Disable execution of AutoRun commands from registry (see below)
/A Causes the output of internal commands to a pipe or file to be ANSI
/U Causes the output of internal commands to a pipe or file to be
Unicode
/T:fg Sets the foreground/background colors (see COLOR /? for more info)
/E:ON Enable command extensions (see below)
/E:OFF Disable command extensions (see below)
/F:ON Enable file and directory name completion characters (see below)
/F:OFF Disable file and directory name completion characters (see below)
/V:ON Enable delayed environment variable expansion using ! as the
delimiter. For example, /V:ON would allow !var! to expand the
variable var at execution time. The var syntax expands variables
at input time, which is quite a different thing when inside of a FOR
loop.
/V:OFF Disable delayed environment expansion.

Note that multiple commands separated by the command separator ‘&&’
are accepted for string if surrounded by quotes. Also, for compatibility
reasons, /X is the same as /E:ON, /Y is the same as /E:OFF and /R is the
same as /C. Any other switches are ignored.

If /C or /K is specified, then the remainder of the command line after
the switch is processed as a command line, where the following logic is
used to process quote (”) characters:

1. If all of the following conditions are met, then quote characters
on the command line are preserved:

- no /S switch
- exactly two quote characters
- no special characters between the two quote characters,
where special is one of: &<>()@^|
- there are one or more whitespace characters between the
the two quote characters
- the string between the two quote characters is the name
of an executable file.

2. Otherwise, old behavior is to see if the first character is
a quote character and if so, strip the leading character and
remove the last quote character on the command line, preserving
any text after the last quote character.

If /D was NOT specified on the command line, then when CMD.EXE starts, it
looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if
either or both are present, they are executed first.

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun

and/or

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun

Command Extensions are enabled by default. You may also disable
extensions for a particular invocation by using the /E:OFF switch. You
can enable or disable extensions for all invocations of CMD.EXE on a
machine and/or user logon session by setting either or both of the
following REG_DWORD values in the registry using REGEDT32.EXE:

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions

and/or

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions

to either 0×1 or 0×0. The user specific setting takes precedence over
the machine setting. The command line switches take precedence over the
registry settings.

The command extensions involve changes and/or additions to the following
commands:

DEL or ERASE
COLOR
CD or CHDIR
MD or MKDIR
PROMPT
PUSHD
POPD
SET
SETLOCAL
ENDLOCAL
IF
FOR
CALL
SHIFT
GOTO
START (also includes changes to external command invocation)
ASSOC
FTYPE

To get specific details, type commandname /? to view the specifics.

Delayed environment variable expansion is NOT enabled by default. You
can enable or disable delayed environment variable expansion for a
particular invocation of CMD.EXE with the /V:ON or /V:OFF switch. You
can enable or disable completion for all invocations of CMD.EXE on a
machine and/or user logon session by setting either or both of the
following REG_DWORD values in the registry using REGEDT32.EXE:

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\DelayedExpansion

and/or

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\DelayedExpansion

to either 0×1 or 0×0. The user specific setting takes precedence over
the machine setting. The command line switches take precedence over the
registry settings.

If delayed environment variable expansion is enabled, then the exclamation
character can be used to substitute the value of an environment variable
at execution time.

File and Directory name completion is NOT enabled by default. You can
enable or disable file name completion for a particular invocation of
CMD.EXE with the /F:ON or /F:OFF switch. You can enable or disable
completion for all invocations of CMD.EXE on a machine and/or user logon
session by setting either or both of the following REG_DWORD values in
the registry using REGEDT32.EXE:

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\CompletionChar
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\PathCompletionChar

and/or

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\PathCompletionChar

with the hex value of a control character to use for a particular
function (e.g. 0×4 is Ctrl-D and 0×6 is Ctrl-F). The user specific
settings take precedence over the machine settings. The command line
switches take precedence over the registry settings.

If completion is enabled with the /F:ON switch, the two control
characters used are Ctrl-D for directory name completion and Ctrl-F for
file name completion. To disable a particular completion character in
the registry, use the value for space (0×20) as it is not a valid
control character.

Completion is invoked when you type either of the two control
characters. The completion function takes the path string to the left
of the cursor appends a wild card character to it if none is already
present and builds up a list of paths that match. It then displays the
first matching path. If no paths match, it just beeps and leaves the
display alone. Thereafter, repeated pressing of the same control
character will cycle through the list of matching paths. Pressing the
Shift key with the control character will move through the list
backwards. If you edit the line in any way and press the control
character again, the saved list of matching paths is discarded and a new
one generated. The same occurs if you switch between file and directory
name completion. The only difference between the two control characters
is the file completion character matches both file and directory names,
while the directory completion character only matches directory names.
If file completion is used on any of the built in directory commands
(CD, MD or RD) then directory completion is assumed.

The completion code deals correctly with file names that contain spaces
or other special characters by placing quotes around the matching path.
Also, if you back up, then invoke completion from within a line, the
text to the right of the cursor at the point completion was invoked is
discarded.

The special characters that require quotes are:
<space>
&()[]{}^=;!’+,`~

How to Enable Verbose Status Messages by editing the Registry


To use enable verbose status messages by editing the registry, follow these steps:
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\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
4. On the Edit menu, point to New, and then click DWORD Value.
5. Type verbosestatus, and then press ENTER.
6. Double-click the new key that you created, type 1 in the Value data box, and then click OK.
7. Quit Registry Editor.
Note Windows does not display status messages if the following key is present and the value is set to 1:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\DisableStatusMessages

How to enable verbose status message in Windows

To use enable verbose status messages by editing the registry, follow these steps:

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\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

4. On the Edit menu, point to New, and then click DWORD Value.
5. Type verbosestatus, and then press ENTER.
6. Double-click the new key that you created, type 1 in the Value data box, and then click OK.
7. Quit Registry Editor.

Note Windows does not display status messages if the following key is present and the value is set to 1:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\DisableStatusMessages

How to Adjust the Visual Effects in Windows XP for Better Performance


How to modify visual effect on Windows XP for performance.

  1. Right Click on My Computer on the desktop of the Windows XP machine.
  2. Select properties.
  3. Select the Advanced tab -> Performance -> Settings
  4. Select the Adjust for best performance radio button which unchecks all visual effect features.

The Visual Effects tab in the Performance Options dialog box allows you to select the settings you want to use for the visual effects and performance of Windows XP. with an easy way to set your preferences for the and performance of Windows XP. You can choose one of the following options:

  1. Let Windows Windows choose what’s best for my computer
  2. Adjust for best performance
  3. Adjust for best appearance
  4. Custom

The custom option allows you to choose which visual effect you want toenable/disable. Adjusting for best apperance uses all of the effects listed; adjusting for best performance uses none of them.

How to Force Internet Explorer 6 GPO Policies to be applied with each login


Steps to Force Internet Explorer 6 GPO Policies to be applied with each login

  1. Access a test client that is failing to receive the policies .
  2. Make the following registry changes:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{A2E30F80-D7DE-11d2-BBDE-00C04F86AE3B}

    And

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}

    Value Name: NoSlowLink

    Data Type: REG_DWORD

    Value: 0

    Purpose: Determines whether or not the client extension will process a group policy when a slow link is detected.

    Value Name: NoGPOListChanges

    Data Type: REG_DWORD

    Value: 0

    Purpose: Determines whether or not the client extension will process a group policy when there are no changes between the cached list of GPOs previously processed and the current list.

  3. Run the following commands to force an update of Group Policy:Windows 2000

    secedit /refreshpolicy user_policy

    Windows XP and 2003

    gpupdate /force

Task Scheduler Exit Codes : exit, task, code, scheduler, results, return


SchedLgU.txt and SchedLog.txt exit/results codes defined:

You will only have a SchedLgU.txt or a SchedLog.txt depending on your operating system.Below is a list of the most common return codes, their meanings and some suggestions for you..

Result: The task completed with an excode of (100a518).

The job is completed successfully, but in many cases the internal tasks of the job are not completed successfully.

For code 0 or 0×0: The operation completed successfully.

For code 1 or 0×1: Incorrect function called or unknown function called.

For code 10 or 0xa: The environment is incorrect.

For code 0×8009000f: General Access denied

General page initialization failed. The specific error is: 0×80041315:

The task scheduler service is not running..
Unable to start task.

The specific error is:

0×80070002: The system cannot find the file specified.

Try using the Task page Browse button to locate the application.
Result Codes and Error Conditions are defined in Ntstatus.h or Winerror.h. These files are available on the MSDN Web site or through MSDN subscription. Because these are commonly used files, a search with the search engine is not likely to produce any useful result..
If a program does not start because the path to the program file is incorrect or because you typed a command-line switch within quotation marks, the following entry is added to the Schedlog.txt (Schedlgu.txt in Windows 2000/2003/XP) file:

“<program name>.job” (<program file name>) <date><time> ** ERROR **

Unable to start task.

The specific error is:

<error code>: The system cannot find the file specified. Try using the Task page Browse button to locate the application.
There is no formal standard for exit codes and no generic list of what exit codes mean. The meaning of the exit code is determined by the application vendor.

Use “err.exe” to track the exit code you are seeing.

A few common return codes are:

0×0: The operation completed successfully.

0×1: An incorrect function was called or an unknown function was called.

0xa: The environment is incorrect.

If the result code has the “C0000XXX” format, the task did not complete successfully (the “C” indicates an error condition).

The most common “C” error code is “0xC000013A: The application terminated as a result of a CTRL+C”.

x8004130f: No account information could be found in the Task Scheduler security database for the task indicated.