Viktor_Kisel 10:43 23-08-2014 Цитата: Хотел для красоты конвертнуть батник в екзешник Обновить_AF.bat -> Обновить_AF.exe, но не работает (батник работает исправно - екзешник не хочет):
@echo off
Можно в FASM сделать, примерно так: [more]
Код: format PE GUI 4.00
entry start
include 'win32wx.inc'
section '.text' code readable executable
start:
invoke GetCurrentDirectory,256,curdir
invoke lstrcat,curdir,fname
invoke CreateFile,curdir,GENERIC_READ,0,0,OPEN_EXISTING,0,0
cmp eax,0FFFFFFFFh
je nothing_error
mov [fhandle],eax
invoke CloseHandle,[fhandle]
invoke ShellExecute,0,0,curdir,0,0,0
exit:
invoke ExitProcess,0
nothing_error:
invoke MessageBox,0,error,caption,MB_ICONINFORMATION
jmp exit
section '.data' data readable writeable
curdir rw 256
caption du 'Warning!',0
error du 'START_UPDATE.bat file not found! ',0Ah
du 'Please check run location. ',0
fname du '\update\START_UPDATE.bat',0
fhandle dd ?
section '.idata' import data readable writeable
library kernel32,'KERNEL32.DLL',user32,'USER32.DLL',shell32,'SHELL32.DLL'
include 'apiw/kernel32.inc'
include 'apiw/user32.inc'
include 'apiw/shell32.inc'