亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
123下一頁
最近訪問板塊 發(fā)新帖
查看: 6896 | 回復(fù): 26
打印 上一主題 下一主題

關(guān)于windows下計劃任務(wù)腳本的問題??  關(guān)閉 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2005-08-21 00:53 |只看該作者 |倒序瀏覽
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2"
Set objNewJob = objWMIService.Get("Win32_ScheduledJob"
errJobCreated = objNewJob.Create _
    ("notepad.exe", "********123000.000000-420", _
        True , 1 OR 4 OR 16, , , JobID)
Wscript.Echo errJobCreated

以上就是這個vbs腳本可以成功執(zhí)行,不知怎樣修改,讓notepad立即執(zhí)行或以幾秒或一分鐘后 執(zhí)行 時間上怎莫修改 還有不要彈出對話框來

論壇徽章:
0
2 [報告]
發(fā)表于 2005-08-21 19:45 |只看該作者

關(guān)于windows下計劃任務(wù)腳本的問題??

Windows Script Host                
Sleep Method

Suspends script execution for a specified length of time, then continues execution.

object.Sleep(intTime)
Arguments
object
WScript object.
intTime
Integer value indicating the interval (in milliseconds) you want the script process to be inactive.
Remarks

The thread running the script is suspended, releasing its CPU utilization. Execution resumes as soon as the interval expires. Using the Sleep method can be useful when you are running asynchronous operations, multiple processes, or if your script includes code triggered by an event. To be triggered by an event, a script must be continually active (a script that has finished executing will certainly not detect an event). Events handled by the script will still be executed during a sleep.
Note   Passing the Sleep method a 0 or –1 does not cause the script to suspend indefinitely.
Example

The following example demonstrates the use of a single .wsf file for two jobs in different script languages (VBScript and JScript). The functionality of both jobs is the same — each runs the Windows calculator and sends it keystrokes to execute a simple calculation.

<package>;
   <job id="vbs">;
      <script language="VBScript">;
         set WshShell = WScript.CreateObject("WScript.Shell"
         WshShell.Run "calc"
         WScript.Sleep 100
         WshShell.AppActivate "Calculator"
         WScript.Sleep 100
         WshShell.SendKeys "1{+}"
         WScript.Sleep 500
         WshShell.SendKeys "2"
         WScript.Sleep 500
         WshShell.SendKeys "~"
         WScript.Sleep 500
         WshShell.SendKeys "*3"
         WScript.Sleep 500
         WshShell.SendKeys "~"
         WScript.Sleep 2500
      </script>;
   </job>;

   <job id="js">;
      <script language="JScript">;
         var WshShell = WScript.CreateObject("WScript.Shell";
         WshShell.Run("calc";
         WScript.Sleep(100);
         WshShell.AppActivate("Calculator";
         WScript.Sleep(100);
         WshShell.SendKeys("1{+}";
         WScript.Sleep(500);
         WshShell.SendKeys("2";
         WScript.Sleep(500);
         WshShell.SendKeys("~";
         WScript.Sleep(500);
         WshShell.SendKeys("*3";
         WScript.Sleep(500);
         WshShell.SendKeys("~";
         WScript.Sleep(2500);
      </script>;
   </job>;
</package>;
See Also

論壇徽章:
0
3 [報告]
發(fā)表于 2005-08-21 20:37 |只看該作者

關(guān)于windows下計劃任務(wù)腳本的問題??

回 renstone921 大哥
謝謝阿
可是我看太不懂啊
能不能再詳細點啊
我不懂vbs

論壇徽章:
0
4 [報告]
發(fā)表于 2005-08-21 20:56 |只看該作者

關(guān)于windows下計劃任務(wù)腳本的問題??

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
   & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2"
Set objNewJob = objWMIService.Get("Win32_ScheduledJob"
errJobCreated = objNewJob.Create _
   ("notepad.exe", "********123000.000000-420", _
       True , 1 OR 4 OR 16, , , JobID)
<package>;
  <job id="vbs">;
     <script language="VBScript">;
        set WshShell = WScript.CreateObject("WScript.Shell"
        WshShell.Run "calc"
        WScript.Sleep 100
        WshShell.AppActivate "Calculator"
        WScript.Sleep 100
        WshShell.SendKeys "1{+}"
        WScript.Sleep 500
        WshShell.SendKeys "2"
        WScript.Sleep 500
        WshShell.SendKeys "~"
        WScript.Sleep 500
        WshShell.SendKeys "*3"
        WScript.Sleep 500
        WshShell.SendKeys "~"
        WScript.Sleep 2500
     </script>;
  </job>;

Wscript.Echo errJobCreated
不能運行

論壇徽章:
0
5 [報告]
發(fā)表于 2005-08-21 21:01 |只看該作者

關(guān)于windows下計劃任務(wù)腳本的問題??

你需要做的僅僅是把下面的代碼段加入你的代碼。
set WshShell = WScript.CreateObject("WScript.Shell"
WshShell.Sleep 2500

論壇徽章:
0
6 [報告]
發(fā)表于 2005-08-21 21:14 |只看該作者

關(guān)于windows下計劃任務(wù)腳本的問題??

renstone921大哥
報錯:對象不支持‘wshell.sleep'

論壇徽章:
0
7 [報告]
發(fā)表于 2005-08-21 21:19 |只看該作者

關(guān)于windows下計劃任務(wù)腳本的問題??

你把你的全部代碼貼出來。

論壇徽章:
0
8 [報告]
發(fā)表于 2005-08-21 21:25 |只看該作者

關(guān)于windows下計劃任務(wù)腳本的問題??

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2"
Set objNewJob = objWMIService.Get("Win32_ScheduledJob"
errJobCreated = objNewJob.Create _
    ("Notepad.exe", "********123000.000000-420", _
        True , 1 OR 4 OR 16, , , JobID)
Wscript.Echo errJobCreated
set WshShell = WScript.CreateObject("WScript.Shell"
WshShell.Sleep 2500
Wscript.Echo errJobCreated
執(zhí)行后可以成功后報錯對象不支持‘wshell.sleep'
sleep 2500 之后不能把notepad啟動

論壇徽章:
0
9 [報告]
發(fā)表于 2005-08-21 21:48 |只看該作者

關(guān)于windows下計劃任務(wù)腳本的問題??

你把下面的代碼為a.vbs,然后用鼠標雙擊來啟動執(zhí)行

set WshShell = WScript.CreateObject("WScript.Shell"

        WScript.Sleep 100001

         WshShell.Run "calc"
         WshShell.AppActivate "Calculator"
         WScript.Sleep 100
         WshShell.SendKeys "1{+}"
         WScript.Sleep 500
         WshShell.SendKeys "2"
         WScript.Sleep 500
         WshShell.SendKeys "~"
         WScript.Sleep 500
         WshShell.SendKeys "*3"
         WScript.Sleep 500
         WshShell.SendKeys "~"
         WScript.Sleep 2500

論壇徽章:
0
10 [報告]
發(fā)表于 2005-08-21 21:55 |只看該作者

關(guān)于windows下計劃任務(wù)腳本的問題??

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2"
Set objNewJob = objWMIService.Get("Win32_ScheduledJob"
errJobCreated = objNewJob.Create _
    ("Notepad.exe", "********123000.000000-420", _
        True , 1 OR 4 OR 16, , , JobID)

set WshShell = WScript.CreateObject("WScript.Shell"
WshShell.Sleep 2500
Wscript.Echo errJobCreated
剛才貼錯了
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP