中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟
中国DOS联盟论坛
现在时间是 2026-08-08 16:13
47,811 主题排行 / 349,895 发帖 / 今日 0 篇 / 48,253 会员排行
DOS批处理 & 脚本技术(批处理室) » 【求助】关于at命令
可打印版本  1,154 / 10
第1楼 plp626 发表于 2008-05-19 21:28
银牌会员 发帖 1,020 积分 2,278
【求助】关于at命令
以前不怎么用at,现在使用它还真发现不好使。
先是启动task scheduler服务就是问题

提示: StartService: OpenService FAILED 1060:
没办法,我只要打开services.msc,手动将计划服务启动了
接着我在cmd下:
这个mytest.vbs代码:

可以到了20:50分什么反应都没的,查看任务管理起,多了个wscript.exe
我忘了at隐藏执行命令了,但我没想到at把我这个mytest.vbs隐藏执行,连对话框都给"弄丢了"
不过:

到了时间会正常显示。
我现在想问大家,
1:服务为什么用sc start 启动出错?应该怎样启动不会出错?
2:怎么让at命令启动VBS后,对话框能不隐藏?
3:大家认为弹对话框最可靠的命令是那个?
第2楼 HAT 发表于 2008-05-19 21:50
版主 发帖 5,017 积分 9,023
1. 是不是你的命令写错了?

sc应该用service_name
net start应该用display_name

SERVICE_NAME: Schedule
DISPLAY_NAME: Task Scheduler

2. at命令创建的计划任务会以system权限运行,VBS的对话框是无法弹出的。可以用schtasks命令创建一个以当前用户运行的计划任务。

3. 没有最可靠的,具体情况具体分析吧。
第3楼 plp626 发表于 2008-05-19 22:06
银牌会员 发帖 1,020 积分 2,278

提示:
StartService FAILED 1056:
第4楼 HAT 发表于 2008-05-19 22:24
版主 发帖 5,017 积分 9,023

如果这样还不行的话,net start可以吗?
第5楼 plp626 发表于 2008-05-19 22:58
银牌会员 发帖 1,020 积分 2,278
Originally posted by HAT at 2008-5-19 10:24 PM:

如果这样还不行的话,net start可以吗?


可以:
net start "Task Scheduler"
第6楼 HAT 发表于 2008-05-20 01:47
版主 发帖 5,017 积分 9,023
奇怪,不知楼主用的哪个版本的系统。到别人电脑上拷贝一个sc.exe,覆盖到自己电脑上不知可否。
第7楼 plp626 发表于 2008-05-20 08:34
银牌会员 发帖 1,020 积分 2,278
Originally posted by HAT at 2008-5-20 01:47 AM:
奇怪,不知楼主用的哪个版本的系统。到别人电脑上拷贝一个sc.exe,覆盖到自己电脑上不知可否。

Microsoft Windows XP
(C) 版权所有 1985-2001 Microsoft Corp.
我机子是刚装的,没有染毒,只是我对SC命令用法不很熟悉
第8楼 HAT 发表于 2008-05-20 09:31
版主 发帖 5,017 积分 9,023
又看了一边帮助,没发现什么特别之处啊。楼主的系统是正版的吗?

C:\test>sc /?
*** Unrecognized Command ***
DESCRIPTION:
SC is a command line program used for communicating with the
NT Service Controller and services.
USAGE:
sc <server> <option1> <option2>...

The option <server> has the form "\\ServerName"
Further help on commands can be obtained by typing: "sc "
Commands:
query-----------Queries the status for a service, or
enumerates the status for types of services.
queryex---------Queries the extended status for a service, or
enumerates the status for types of services.
start-----------Starts a service.
pause-----------Sends a PAUSE control request to a service.
interrogate-----Sends an INTERROGATE control request to a service.
continue--------Sends a CONTINUE control request to a service.
stop------------Sends a STOP request to a service.
config----------Changes the configuration of a service (persistant).
description-----Changes the description of a service.
failure---------Changes the actions taken by a service upon failure.
qc--------------Queries the configuration information for a service.
qdescription----Queries the description for a service.
qfailure--------Queries the actions taken by a service upon failure.
delete----------Deletes a service (from the registry).
create----------Creates a service. (adds it to the registry).
control---------Sends a control to a service.
sdshow----------Displays a service's security descriptor.
sdset-----------Sets a service's security descriptor.
GetDisplayName--Gets the DisplayName for a service.
GetKeyName------Gets the ServiceKeyName for a service.
EnumDepend------Enumerates Service Dependencies.

The following commands don't require a service name:
sc <server> <command> <option>
boot------------(ok | bad) Indicates whether the last boot should
be saved as the last-known-good boot configuration
Lock------------Locks the Service Database
QueryLock-------Queries the LockStatus for the SCManager Database
EXAMPLE:
sc start MyService

Would you like to see help for the QUERY and QUERYEX commands? :
第9楼 plp626 发表于 2008-05-20 09:51
银牌会员 发帖 1,020 积分 2,278
盗版,
sc /?
*** Unrecognized Command ***
DESCRIPTION:
SC is a command line program used for communicating with the
NT Service Controller and services.
USAGE:
sc <server> <option1> <option2>...

The option <server> has the form "\\ServerName"
Further help on commands can be obtained by typing: "sc "
Commands:
query-----------Queries the status for a service, or
enumerates the status for types of services.
queryex---------Queries the extended status for a service, or
enumerates the status for types of services.
start-----------Starts a service.
pause-----------Sends a PAUSE control request to a service.
interrogate-----Sends an INTERROGATE control request to a service.
continue--------Sends a CONTINUE control request to a service.
stop------------Sends a STOP request to a service.
config----------Changes the configuration of a service (persistant).
description-----Changes the description of a service.
failure---------Changes the actions taken by a service upon failure.
qc--------------Queries the configuration information for a service.
qdescription----Queries the description for a service.
qfailure--------Queries the actions taken by a service upon failure.
delete----------Deletes a service (from the registry).
create----------Creates a service. (adds it to the registry).
control---------Sends a control to a service.
sdshow----------Displays a service's security descriptor.
sdset-----------Sets a service's security descriptor.
GetDisplayName--Gets the DisplayName for a service.
GetKeyName------Gets the ServiceKeyName for a service.
EnumDepend------Enumerates Service Dependencies.

The following commands don't require a service name:
sc <server> <command> <option>
boot------------(ok | bad) Indicates whether the last boot should
be saved as the last-known-good boot configuration
Lock------------Locks the Service Database
QueryLock-------Queries the LockStatus for the SCManager Database
EXAMPLE:
sc start MyService

Would you like to see help for the QUERY and QUERYEX commands? :
第10楼 HAT 发表于 2008-05-20 10:23
版主 发帖 5,017 积分 9,023
第11楼 plp626 发表于 2008-05-20 12:05
银牌会员 发帖 1,020 积分 2,278
感动下,兄的这份真诚让我心里倍感温暖。
谢谢,
[ 联系联盟系统管理团队 - 中国DOS联盟 - 标准版 ]
Sponsored by ifanr Inc | © 2001–2023