I am on the way of doing antivirus sample project.I can have a problem of delete the exe file of virus.The Exception message is Java.io.exception:CreateProcess error=2.What is the reason for Create process error=2.Please help me.
Win32's CreateProcess returns a 2 as error code when it cannot find the command you specify; more specifically, when the command does not refer to an executable file on its lookup path.
Without some actual code, this is about as far as we can help you.
Thank u for ur reply.
I attach my code here,
File f=new File("C:/WINZIP_TMP.exe");
Go thru the code and give ur's Valuable suggestion.
Try "C:\\WINZIP_TMP.exe" instead of "C:/WINZIP_TMP.exe". Windows uses backslashes as path separator, and while the File class may translate it, Runtime.exec won't.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.