473,382 Members | 1,078 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

run a C# project from .cmd file

7
Hi all,
I have a C# for parsing .csv file. It consists of two classes. In the class parser I have a function readInput(string) that reads a txt file which contains the folder locations of the csv files. When I execute the project from the visual studio development everything is fine. But writing the .cmd like this does not return any result.

copy C:\BoxParser\bin\Release\BoxParser.exe C:\temp

c:\temp\BoxParser Parser readInput C:\RecipeParser\RecipeParser\bin\Release\input.txt

del c:\temp\RecipeParser.exe

pause

The problem is that it doesn#t execute the function readInput. Any ideas ?
Thanks in advance.

Oliver
Jul 30 '08 #1
3 2013
Plater
7,872 Expert 4TB
I don't understand what you were trying to do in that line in your cmd file, but if you have a console application that takes a filename as an argument (that filename could then be passed into that function of yours), you could certainly run it from a cmd file.
Jul 30 '08 #2
igurov
7
Hi all,
I have a C# project that compiles without problem under visual studio. Now I want to call a function from this project for reading files from a txt file in an .cmd file. I tried with the following code where Parser is the name of the Project, ParserClass is the name of the class where the function is and readInput is the name of my function , but it does't execute it.


copy C:\Parser\Parser\bin\Release\Parser.exe C:\temp
c:\temp\Parser ParserClass readInput C:\Parser\Parser\bin\Release\input.txt
del c:\temp\RecipeParser.exe
pause

Any help would be appreciated.
Aug 4 '08 #3
Plater
7,872 Expert 4TB
I think we went over this before.
EDIT: yes we did, I have merged the threads. Please do not double post as it is against the posting guidelines.
MODERATOR


You cannot just "call" a function defined in a program like that.
You can have your program take arguments in and based on the passed in arguments, perform some operation inside your program.

for instance you could check to see if the first argument was "readinput" and then call the function in code using the 2nd argument passed.

If you are having trouble understanding the arguments, please check in on a basic tutorial for more indepth explanations of how to use them.
Aug 4 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: A.J.B 2.K.3 | last post by:
im trying to work throught the mags(finially) but the first one is giving me code warrior's compiler is giving me the following errors/warnings,any help please? Error : undefined identifier...
2
by: RSB | last post by:
Hi Every one, I am currently using Visual Studio .Net and trying to open a project from SourceSafe and once i open the project for the first time i get the following error/warning... "The...
5
by: David Webb | last post by:
The problem started when the Working Folder for a project was somehow set to the folder of another project. I set the correct working folder in VSS and deleted the .vbproj files that had been...
1
by: Steven T. Hatton | last post by:
I think Danny was one cup of coffee shy of full consciousness when he wrote this, but the gist of it makes sens to me: "C++ Project Organization Guidelines Last updated May 26, 2005....
4
by: Brad | last post by:
I'm not one to rant or flame....so please excuse me while I do so for this once. I've now spent a bit of time working with VS2005 beta 2 to see how it functions for web development, especially how...
8
by: vinesh | last post by:
I have sample Asp.Net Web Application project. Let me know how to keep the files related to this project (like the webform.aspx, WebForm1.aspx.vb, WebForm1.aspx.resx) in a separate folder within a...
0
by: thjwong | last post by:
I'm using WinXP with Microsoft Visual C++ .NET 69462-006-3405781-18776, Microsoft Development Environment 2003 Version 7.1.3088, Microsoft .NET Framework 1.1 Version 1.1.4322 SP1 Most developers...
3
by: Jerad Rose | last post by:
This is regarding Visual Studio 2003 (framework 1.1). We have several projects/libraries. Of course, many of these reference each other. If we only had one solution, we would simply add all of...
4
by: Alan Mailer | last post by:
Again, I'm new to VB.net and there is something I need help with: Like (I assume) many of us, over time I want to be able to create some VB.net classes that I might want to use in more than one...
1
by: =?Utf-8?B?cnNvbWFzdW5kYXI=?= | last post by:
Hi, I got the following error while trying to run the project in ASP.Net 2003 to one of my application in my machine. I think some where im loosing the IIS configurations. Error Detail:...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.