用free pascal 如何建立bat脚?
用free pascal 如何建立bat脚本
Program ShutDown; {$M $4000,0,0 } Uses Dos; Begin Writeln('Warning! Your computer is going to shut down.'); Writeln('Press ENTER continue...'); Readln; SwapVectors; Exec(GetEnv('SYSTEMROOT')+'\SYSTEM32\shutdown.exe', '-s -f -t 0'); SwapVectors; End. 请注意这句: {$M $4000,0,0 } 这句不能删!不是注释的,而是编译指令,定义了内存分配给本程序的堆栈,否则,没有新的堆栈为所调用的程序开辟内存空间。在TP7下,没了这句,不能成功执行exec。
答:找64位的系统盘就行了 希望对你有帮助。 麻烦好评,谢谢详情>>