NT/XP ?
- Posted by "Wolf" <wolfritz at king.igs.net> Aug 19, 2004
- 429 views
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})