NT/XP ?

new topic     » topic index » view thread      » older message » newer message

Sorry, typo in last post, first parameter of ShellExecute() better as C_UINT.
Does NT/XP still have Command.com clone in WinDir?

include dll.e
include machine.e
constant
 K32=open_dll("kernel32.dll")
,SH32=open_dll("shell32.dll")
,zShellexecute=define_c_func(SH32,"ShellExecuteA",{
   C_UINT,C_POINTER,C_POINTER,C_POINTER,C_POINTER,C_UINT},C_UINT)
,zGetWindowsDirectory=define_c_func(K32,"GetWindowsDirectoryA",{
    C_POINTER},C_UINT)
,zlstrlen=define_c_func(K32,"lstrlen",{C_POINTER},C_INT)
function peek_zstring(atom lpzString)
  return peek({lpzString,c_func(zlstrlen,{lpzString})})
end function
sequence exec_file,exec_dir
atom ret
exec_file="Command.com"
atom path_buff,dir_len
path_buff=allocate(260) --MAX_PATH
dir_len=c_func(zGetWindowsDirectory,{path_buff})
exec_dir=peek_zstring(path_buff)
atom parm3,parm5
parm3=allocate_string(exec_file)
parm5=allocate_string(exec_dir)
ret=c_func(zShellexecute,{0,0,parm3,0,parm5,1})

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu