16,016,557 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by KothaSanjay (Top 8 by date)
KothaSanjay
13-Aug-12 3:22am
View
@Prabhakar,
Ive tried this , but getting the same error again !!
KothaSanjay
11-Jul-12 3:54am
View
No ,the code which i posted was the one which is from my development system
and there the path is "C:\\Program Files\\Symantec AntiVirus\\DoScan.exe"
and i mentioned the correct path while testing in the server.
sorry i will update the question.
Looking for the correct solution.
Thanks in advance
KothaSanjay
10-Jul-12 6:08am
View
it already mentioned in on of the comments which i posted..
KothaSanjay
10-Jul-12 5:22am
View
Thank you for ur help!
KothaSanjay
10-Jul-12 5:04am
View
Yes, In XP i have done this and when i attempted to do the same in windows server 2008 the DoScan.exe doesn't get open and nothing happens when i double click it.
Is this a drawback of Symantic anit virus system?
KothaSanjay
10-Jul-12 4:01am
View
yes i have given the absolute path for the for calling the executable.and the below lines of code does exactly the same.
myProcess.StartInfo.FileName = "C:\\Program Files\\Symantec AntiVirus\\DoScan.exe";
string myprocarg = "C:\\Program Files\\Symantec\\Symantec Endpoint Protection\\DoScan.exe /cmdlinescan " + strFile + "/LOGFILE=\\" + strFilePath + "\\Logs\\" + Path.GetFileName(strFile) + ".log\"";
myProcess.StartInfo.Arguments = myprocarg;
myProcess.Start();
KothaSanjay
10-Jul-12 3:50am
View
ok below is the code which intended to scan the files from a specified path to moves the scanned files to a target folder.It creates log files for the files whose scanning process has started. It works perfectly in XP but donno y it doest work in Windows server 2008 .Here the DoScan.exe doest get called and no log file get generated. The only exception that the code throws is file not found, and it is refering to the log file which is not gereated by the DoScan.exe
public void PerformScanning(string[] strfiles, string strFilePath,string strDestPath)
{
try
{
Process myProcess;
FileStatus objFileStatus;
myProcess = new Process();
if (!Directory.Exists(strFilePath + "\\Logs"))
{
Directory.CreateDirectory(strFilePath + "\\Logs");
}
foreach (string strFile in strfiles)
{
objFileStatus = new FileStatus();
myProcess.StartInfo.FileName = "C:\\Program Files\\Symantec AntiVirus\\DoScan.exe";
string myprocarg = "C:\\Program Files\\Symantec\\Symantec Endpoint Protection\\DoScan.exe /cmdlinescan " + strFile + "/LOGFILE=\\" + strFilePath + "\\Logs\\" + Path.GetFileName(strFile) + ".log\"";
myProcess.StartInfo.Arguments = myprocarg;
myProcess.Start();
myProcess.WaitForExit();
int j = 0;
int y = 0;
for (j = 0; j <= 1000000; j++)
{
y = y + 1;
}
string FILENAME = strFilePath + "\\Logs\\" + Path.GetFileName(strFile) + ".log";
string SearchLine = null;
bool IsClean = true;
string MyFound = null;
StreamReader objStreamReader = default(StreamReader);
objStreamReader = File.OpenText(FILENAME);
while (objStreamReader.Peek() != -1)
{
SearchLine = objStreamReader.ReadLine();
if (SearchLine.Contains("Found"))
{
IsClean = false;
MyFound = SearchLine;
}
}
objStreamReader.Close();
if (IsClean)
{
File.Move(strFile, strDestPath + "\\" + Path.GetFileName(strFile));
if (File.Exists(strFilePath + "\\" + strfiles))
{
File.Delete(strFilePath + "\\" + strfiles);
}
objFileStatus.UpdateUploadedFileStatus("Sucess", "Y", strDestPath + "\\" + Path.GetFileName(strFile), Path.GetFileNameWithoutExtension(strFile).Substring(6, Path.GetFileNameWithoutExtension(strFile).Length - 6), "No threat detected");
Console.WriteLine("File:" + strFile + "Scanned Sucessfully");
File.Delete(strFilePath + "\\Logs\\" + Path.GetFileName(strFile) + ".log");
}
else
{
string path = strFile;
File.Delete(path);
objFileStatus.UpdateUploadedFileStatus("Failure", "N", strFile, Path.GetFileNameWithoutExtension(strFile).Substring(6, Path.GetFileNameWithoutExtension(strFile).Length - 6), "Virus Found");
Console.WriteLine("File:" + path + "Deleted.");
}
}
}
catch
{
Console.Write("The Process Cannot be completed due to some exception");
}
}
KothaSanjay
11-May-12 5:27am
View
Hello losmac thank 4 your reply.
but what i posted was the message generated from the exception log file.
Let me be more specific.
I have a gridveiew in my screen and just above it i placed export excel option.For this purpose ive used the open souce tool carlosag excel generator.To know more about it Refer (http://www.carlosag.net/tools/excelxmlwriter/)
and finally ive checked my design code if i have missed any closing tags.
found everything was fine...Just guide me if the error msg is misleading one.
Show More