Classic Collection: Use and Example of Network Command Line (3)

xiaoxiao2021-03-06  19

Source: www.net130.com Date: 2005-03-03

Load cmd.exe

AT does not automatically load the cmd.exe before running the command. If you do not run an executable file (.exe), you must use the method shown below to load cmd.exe in the beginning of the command.

CMD / C DIR> C: /TEST.OUT.

View the planned command

When you use AT without command line options, the planned task will appear in a table similar to the following format:

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

Contains identification number (ID)

When using the AT command with the identification number (ID) under command prompt, the information of a single task item is displayed in a format similar to:

Task ID: 1

Status: OK

Schedule: EACH F

Time of Day: 4: 30 PM

Command: Net Send Group Leads Status Due When you plan a command with AT (especially with commands with command line options), you want to check if the command syntax is correct by typing the AT without a command line option. If the information is displayed in the "Command Line" column, delete the command and retrore it. If it is not correct, you can bring less command line option when you retrore this command.

View Results

Use AT's already planned command to run as a background program. The result is not displayed on the computer. To redirect the output to a file, use the redirect symbol (>). If you redirect the output to a file, whether you use AT in the command line or in a batch file, you need to use an escape (^) before the redirect symbol. For example, to redirect the output to the OUTPUT.TEXT file, type:

AT 14:45 c: /test.bat ^> C: /output.txt

The current directory of execution is the SystemRoot folder.

Change system time

After using the AT command to plan the command to run, if the computer's system time is changed, the AT scheduler is synchronized with the modified system time by typing the AT that does not command line options.

Storage command

The planned command is stored in the registry. This way, if you restart the Plan service, you will not lose the planned task.

Connect to the network drive

For schedule jobs that need to access the network, do not use the reordered drive. The Plan Services may not access these redirected drives, or if there are other users log in when the scheduled task is running, these redirected drives may not appear. Therefore, for the planning job, use the UNC path. E.g:

AT 1:00 PM MY_BACKUP // Server / Share

Please do not use the following syntax (where x:? Indicates the connection created by the user):

AT 1:00 PM My_Backup x:

If a AT command using the drive letter is planned to connect to the shared directory, you should include an AT command to disconnect the drive when the drive is complete. If the connection to the drive cannot be disconnected, the assigned drive letter will not be available under the command prompt.

example

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

AT // marketing

To learn more about the server Corp's command number 3, type:

AT // Corp 3 To plan to run the network sharing command on the Corp server at 8:00 AM and redirect the list to the Corp.txt file of the maintenance server (in the Reports Shared Directory), type:

AT // Corp 08:00 CMD / C "NET Share Reports = D: / Marketing / Reports >> //maintence/reports/corp.txt"

In order to back up the Marketing server's hard drive's hard drive's hard drive's hard drive back up to the tape drive, first create a batch program named Archive.cmd, then plan the batch program to run, type:

AT // Marketing 00:00 / Every: 5,10,15,20,25,30 Archive

To cancel all the scheduled commands already planned on the current server, clear the AT program information as follows:

AT / Delete

If the command to run is not an executable (.exe) file, use cmd / c to load CMD.exe before this command as follows:

CMD / C DIR> C: /TEST.OUT.

转载请注明原文地址:https://www.9cbs.com/read-42655.html

New Post(0)