Page 1 of 1

AT commands: why does it not work?

Posted: 15 Jan 2013 06:05
by tinfanide

Code: Select all

at 00:00 /interactive "echo hi"

Why does it not work?

But if:

Code: Select all

at 00:00 "cmd /c echo something > C:\something.txt"

It works.

Re: AT commands: why does it not work?

Posted: 15 Jan 2013 07:51
by Ed Dyreen
tinfanide wrote:

Code: Select all

at 00:00 /interactive "echo hi"

Why does it not work?
I am not convinced it works or not as the evidence for that conclusion is missing. Try

Code: Select all

at 00:00 /interactive "echo hi &pause"

Re: AT commands: why does it not work?

Posted: 21 Jan 2013 01:48
by tinfanide

Code: Select all

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>at 15:47 /interactive "echo hi &pause"
Warning: Due to security enhancements, this task will run at the time
expected but not interactively.
Use schtasks.exe utility if interactive task is required ('schtasks /?'
for details).
Added a new job with job ID = 1

C:\Windows\system32>


Same result.

Re: AT commands: why does it not work?

Posted: 21 Jan 2013 04:06
by shirulkar
At does not automatically load Cmd.exe, the command interpreter. If you are not running an executable (.exe) file, you must explicitly load CMD at the beginning of the command e.g. cmd /c dir
Don’t try to pass more than one command into AT, put multiple commands into a batch file and then call the batch file from AT.

also by default only a Local Administrator can issue an AT command, a Domain Admin can direct the command at any machine.
To configure an AT job as part of a users login script - the user must be a member of the local Administrators group.

Re: AT commands: why does it not work?

Posted: 21 Jan 2013 04:29
by Ed Dyreen
Hi tinfanide, thanks for the evidence removing all doubt :)
tinfanide wrote:

Code: Select all

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>at 15:47 /interactive "echo hi &pause"
Warning: Due to security enhancements, this task will run at the time
expected but not interactively.
Use schtasks.exe utility if interactive task is required ('schtasks /?'
for details).
Added a new job with job ID = 1

C:\Windows\system32>


Same result.
Well it works, but not interactively. It is true that you can use schtasks as well to plan your tasks but there are differences.
AT can run under system account interactive, but obviously not on your newer not XP OS :?
shirulkar wrote:At does not automatically load Cmd.exe, the command interpreter. If you are not running an executable (.exe) file, you must explicitly load CMD at the beginning of the command e.g. cmd /c dir
I strongly doubt this and certainly not true for XP !

ed

Re: AT commands: why does it not work?

Posted: 21 Jan 2013 04:56
by foxidrive
Ed Dyreen wrote:
shirulkar wrote:At does not automatically load Cmd.exe, the command interpreter. If you are not running an executable (.exe) file, you must explicitly load CMD at the beginning of the command e.g. cmd /c dir
I strongly doubt this and certainly not true for XP !

ed


It doesn't work in XP, but it lets you create the job without authenticating the command. The lower 'Error' part is the status after it was supposed to run, it did nothing.

Code: Select all

c:\>at 21:54 /interactive "echo hi &pause"
Added a new job with job ID = 1

c:\>at
Status ID   Day                     Time          Command Line
----------------------------------------------------------------------
Error   1   Tomorrow                21:54 PM      "echo hi &pause"

Re: AT commands: why does it not work?

Posted: 21 Jan 2013 05:12
by Ed Dyreen
'
I do not doubt that as I've never planned raw batch commands. I doubt what you quoted, and that statement stands.
When running raw batch commands, then use cmd /c, but otherwise not necessary.

Code: Select all

cmd /c "echo hi &pause"
or
myBatch.CMD
First two posts will fail I see that now, but will be planned.

Regards