execfile with use of cmd
Blitz3D Forums/Blitz3D Programming/execfile with use of cmd
| ||
i must use this command into a loop execfile "cmd /c copy...... /Y" for use with several files and folders after repeat this command into a loop (not during execution) i press CTRL+ALT+CANC and i note that several conime.exe are still in execution. is it normal? how i can detect if conime stop execution? |
| ||
I have no idea what conime.exe is, but since you are using the "copy" command, couldn't you use CopyFile instead? |
| ||
conime.exe is named console ime by system, seems that origin is microsoft but many people link conime with a backdoor bfghost1.0. the problem is that if i repeat many execfile command after the closing of this remains many process named conime.exe. And always i see almost one instance of conime after close execfile execution (via closing all main program...) |
| ||
I agree with Warner. Highly suggest to use the native file commands. |
| ||
I also second (third?) Warner's suggestion of using CopyFile. There's no real need to use external files. Also, the only way to check for running processes would be to hook in to the windows API (i.e you need decls/userlibs) Found under winmgmt.dll I believe. Plus, if you intend to stop any processes, then your prohgram would need to be run with certain priviledges too. Incidentally, might I askt the actual format you have used for the cmd command? The reason I ask, is that I suddenly remembered a question ion here about "Renaming files", and I realised, it ought to be possible with a similar method, to call cmd.exe then REN, however, I am unable to get it to work: Function RenameFile(Path$="",NewFile$="New File") ExecFile(Chr$(34)+"%SYSTEMROOT%\cmd.exe"+Chr(34)+" REN "+Path$+" "+NewFile$) End Function |
| ||
You need the /c switch to execute a command. Also, it might be a good idea using quotes around filenames, since dos doesn't handle filenames with spaces that well. |
| ||
Thanks Warner. Longer names as well as those with spaces may need to be converted to that old "Blah~1" format too? |
| ||
nvm :) I sussed it, thanks Warner. stupid me had the function, but wasn't calling it >.< |