user-0 提问: 一个小问题关于自动关机函数

回复:
user: user-1
content: 引用 3 楼 zhao4zhong1 的回复:dir /b c:\windows\system32\*.exe C:\>dir /w c:\windows\system32\*.exe  驱动器 C 中的卷是 C_HD5_1  卷的序列号是 1817-D526   c:\windows\system32 的目录  accwiz.exe             AcSignOpt.exe          actmovie.exe           ahui.exe               alg.exe append.exe             arp.exe                asr_fmt.exe            asr_ldm.exe            asr_pfu.exe at.exe                 ati2evxx.exe           Ati2mdxx.exe           atiapfxx.exe           atibtmon.exe ATIODCLI.exe           ATIODE.exe             atmadm.exe             attrib.exe             auditusr.exe AUTMGR32.EXE           autochk.exe            autoconv.exe           autofmt.exe            autolfn.exe azrlreg.exe            BocomSetupCmd.exe      bocomuninst.exe        bootcfg.exe            cacls.exe calc.exe               cd2chain.exe           certreq.exe            certutil.exe           change.exe charmap.exe            chglogon.exe           chgport.exe            chgusr.exe             chkdsk.exe chkntfs.exe            choice.exe             cidaemon.exe           cipher.exe             cisvc.exe ckcnv.exe              cleanmgr.exe           cliconfg.exe           clip.exe               clipbrd.exe clipsrv.exe            clspack.exe            cluster.exe            cmd.exe                cmdkey.exe cmdl32.exe             cmmon32.exe            cmstp.exe              comclust.exe           comp.exe compact.exe            conime.exe             control.exe            convert.exe            cprofile.exe cscript.exe            csrss.exe              csvde.exe              ctfmon.exe             ctfmon_old.exe cys.exe                dcgpofix.exe           dcomcnfg.exe           dcphelp.exe            dcpromo.exe ddeshare.exe           debug.exe              defrag.exe             dfrgfat.exe            dfrgifc.exe dfrgntfs.exe           dfscmd.exe             dfsinit.exe            dfssvc.exe             dhcpwiz.exe diantz.exe             diskpart.exe           diskperf.exe           diskraid.exe           dllhost.exe dllhst3g.exe           dmadmin.exe            dmremote.exe           dnswiz.exe             doskey.exe dosx.exe               dplaysvr.exe           dpnsvr.exe             dpvsetup.exe           driverquery.exe drmupgds.exe           drwatson.exe           drwtsn32.exe           dsadd.exe              dsget.exe dsmod.exe              dsmove.exe             dsquery.exe            dsrm.exe               dumprep.exe dvdplay.exe            dvdupgrd.exe           dwwin.exe              dxdiag.exe             edlin.exe esentutl.exe           eudcedit.exe           eventcreate.exe        eventtriggers.exe      eventvwr.exe exe2bin.exe            expand.exe             extrac32.exe           fastopen.exe           fc.exe femgrate.exe           find.exe               findstr.exe            finger.exe             fixmapi.exe FlashPlayerApp.exe     flattemp.exe           fltmc.exe              fontview.exe           forcedos.exe forfiles.exe           freedisk.exe           fsutil.exe             ftp.exe                gdi.exe getmac.exe             gettype.exe            gpresult.exe           gpupdate.exe           grpconv.exe help.exe               hostname.exe           HP1100SM.EXE           icacls.exe             icardagt.exe ie4uinit.exe           ieudinit.exe           iexpress.exe           imapi.exe              insrepim.exe inuse.exe              ipconfig.exe           ipsec6.exe             ipxroute.exe           ismserv.exe java.exe               javaw.exe              javaws.exe             jdbgmgr.exe            jetconv.exe jview.exe              krnl386.exe            label.exe              lcwiz.exe              ldifde.exe licmgr.exe             llsmgr.exe             llssrv.exe             locator.exe            lodctr.exe logagent.exe           logman.exe             logoff.exe             logonui.exe            lpq.exe lpr.exe                lsass.exe              LVComS.exe             macfile.exe            magnify.exe makecab.exe            MDM.EXE                mem.exe                mmc.exe                mmcperf.exe mnmsrvc.exe            mobsync.exe            mountvol.exe           mplay32.exe            mpnotify.exe mqbkup.exe             mqdssvc.exe            mqmig.exe              mqsvc.exe              mqtgsvc.exe mrinfo.exe             MRT.exe                mscdexnt.exe           msdtc.exe              msfeedssync.exe msg.exe                mshta.exe              msiexec.exe            mspaint.exe            msppcnfg.exe msswchx.exe            mstinit.exe            mstsc.exe              narrator.exe           nbtstat.exe nddeapir.exe           net.exe                net1.exe               netdde.exe             netset03.exe netsh.exe              netstat.exe            nlb.exe                nlbmgr.exe             nlsfunc.exe notepad.exe            nslookup.exe           ntbackup.exe           ntdsutil.exe           ntfrs.exe ntfrsutl.exe           ntkrnlpa.exe           ntoskrnl.exe           ntsd.exe               ntvdm.exe nw16.exe               nwscript.exe           odbcad32.exe           odbcconf.exe           oobechk.exe openfiles.exe          osk.exe                packager.exe           pathping.exe           pentnt.exe perfmon.exe            ping.exe               powercfg.exe           PresentationHost.exe   print.exe progman.exe            proquota.exe           proxycfg.exe           qappsrv.exe            qprocess.exe query.exe              quser.exe              qwinsta.exe            r2repair.exe           RACMGR32.EXE rasautou.exe           rasdial.exe            rasphone.exe           rcimlby.exe            rcp.exe rdpclip.exe            rdsaddin.exe           rdshost.exe            recover.exe            redir.exe redircmp.exe           redirusr.exe           reg.exe                regedt32.exe           regini.exe register.exe           regsvr32.exe           regwiz.exe             relog.exe              remrras.exe replace.exe            reset.exe              rexec.exe              route.exe              routemon.exe rraswiz.exe            rsh.exe                rsm.exe                rsmmllsv.exe           rsmsink.exe rsmui.exe              rsnotify.exe           rsopprov.exe           rtcshare.exe           runas.exe rundll32.exe           runonce.exe            rwinsta.exe            sacsess.exe            savedump.exe sc.exe                 scardsvr.exe           schtasks.exe           schupgr.exe            sdbinst.exe secedit.exe            services.exe           sessmgr.exe            sethc.exe              setup.exe setupn.exe             setver.exe             setx.exe               sfc.exe                sfmprint.exe sfmpsexe.exe           sfmsvc.exe             shadow.exe             share.exe              shmgrate.exe shrpubw.exe            shutdown.exe           sigverif.exe           skeys.exe              smbinst.exe smlogsvc.exe           smss.exe               sndrec32.exe           sndvol32.exe           sort.exe spoolsv.exe            sprestrt.exe           spupdsvc.exe           subst.exe              svchost.exe syncapp.exe            sysedit.exe            syskey.exe             sysocmgr.exe           systeminfo.exe systray.exe            takeown.exe            tapicfg.exe            taskkill.exe           tasklist.exe taskmgr.exe            tcmsetup.exe           tcpsvcs.exe            telnet.exe             timeout.exe tlntadmn.exe           tlntsess.exe           tlntsvr.exe            tlsbln.exe             tracerpt.exe tracert.exe            tsadmin.exe            tscon.exe              tscupgrd.exe           tsdiscon.exe tsecimp.exe            tskill.exe             tsprof.exe             tssdis.exe             tsshutdn.exe TsWpfWrp.exe           typeperf.exe           tzchange.exe           unlodctr.exe           upg351db.exe ups.exe                user.exe               userinit.exe           utilman.exe            uwdf.exe vds.exe                vdsldr.exe             verclsid.exe           verifier.exe           vsjitdebugger.exe vssadmin.exe           vssvc.exe              vwipxspx.exe           w32tm.exe              waitfor.exe wdfmgr.exe             wextract.exe           where.exe              whoami.exe             wiaacmgr.exe winchat.exe            WINDBVER.EXE           WinFXDocObj.exe        winhlp32.exe           winlogon.exe winmsd.exe             winspool.exe           winver.exe             WISPTIS.EXE            wjview.exe wlbs.exe               wowdeb.exe             wowexec.exe            wpabaln.exe            wpnpinst.exe write.exe              wscript.exe            wuauclt.exe            wuauclt1.exe           wupdmgr.exe xcopy.exe              ZSHP1020.EXE              412 个文件    121,608,256 字节                0 个目录  7,938,596,864 可用字节

user: user-2
content: Windows XP快捷键和命令行大全 http://blog.163.com/tab_98/blog/static/1192409720159892410983

user: user-3
content: windows下有API函数，使用C或者C++都可以，不过忘了是什么了。你可以百度一下，只记得要引用windows.h头文件。 给你找了一篇blog，参考一下吧。 http://blog.csdn.net/dragon101788/article/details/7312815

user: user-0
content: 引用 1 楼 user-7 的回复:shutdown.exe -a　取消关机 　　shutdown.exe -s 关机 　　shutdown.exe -f　强行关闭应用程序 　　shutdown.exe -m \\计算机名　控制远程计算机 　　shutdown.exe -i　显示“远程关机”图形用户界面，但必须是Shutdown的第一个参数 　 　　shutdown.exe -l　注销当前用户 　　shutdown.exe -r　关机并重启 　　shutdown.exe -s -t 时间　设置关机倒计时 　　shutdown.exe -h 休眠

user: user-4
content: system 本质上调用命令行来执行，所以你只需要看 cmd 里能执行什么他都能执行。 不过前提是你的程序是命令行程序，否则也没用。

user: user-5
content: 楼主是不是想用自己的双手成就优化使用的梦想？ 看看脚本语言吧，我当时也是自己想做个便捷实用的游戏选择器什么的，结果用脚本只弄成了字符版本，后来还是用高级语言写的图形化版本

user: user-1
content: dir /b c:\windows\system32\*.exe

user: user-6
content: shutdown -s -t 1，表示1s后关机 shutdown -s，没有指定时间的话，默认30s后关机

user: user-7
content: shutdown.exe -a　取消关机 　　shutdown.exe -s 关机 　　shutdown.exe -f　强行关闭应用程序 　　shutdown.exe -m \\计算机名　控制远程计算机 　　shutdown.exe -i　显示“远程关机”图形用户界面，但必须是Shutdown的第一个参数 　 　　shutdown.exe -l　注销当前用户 　　shutdown.exe -r　关机并重启 　　shutdown.exe -s -t 时间　设置关机倒计时 　　shutdown.exe -h 休眠