看不出哪里不对呀!可就是提示表达示错误,兄弟们帮我看一下是哪里出错了,改正一下Global $FileDir=@ScriptDir &"\RunFile"
if $Cmdline[0] = "" then
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "Runs", "REG_SZ",@ScriptDir& "" &"Run.exe /R")
Exit
Endif
if $Cmdline[1] = "/D" then
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "Runs")
Exit
Endif
If $CmdLine[1] = "/R" Then
If Not FileExists($FileDir) Then
MsgBox(4096, "警告", "程序目录未发现程序文件夹 RunFile,准备重新写入。", 10)
DirCreate($FileDir)
Exit
EndIf
$search = FileFindFirstFile($FileDir &"\*.exe")
runexe()
$search = FileFindFirstFile($FileDir &"\*.bat")
runbat()
$search = FileFindFirstFile($FileDir &"\*.reg")
regedit()
Func runexe();运行exe
If $search = -1 Then
EndIf
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
Run($FileDir&"" &$file)
WEnd
FileClose($search)
endfunc
Func runbat();运行bat
If $search = -1 Then
EndIf
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
Run($FileDir&"" &$file, "",@SW_HIDE)
WEnd
FileClose($search)
endfunc
Func regedit();注册表
If $search = -1 Then
EndIf
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
Run(@ComSpec & " /c " & "regedit.exe /s " &$FileDir&"" &$file, "", @SW_HIDE)
WEnd
FileClose($search)
endfunc
EndIf
|