Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Question] Shell command at c#
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Estx
Expert Cheater
Reputation: 0

Joined: 04 Mar 2008
Posts: 172

PostPosted: Thu May 15, 2008 9:42 am    Post subject: Reply with quote

Code:
Process.Start(@"c:\tasm\bin\tasm.exe", @"/zi c:\file.ext");
Process.Start(@"c:\tasm\bin\tlink.exe", @"/v c:\file.ext");
Process.Start(@"c:\tasm\bin\td.exe", @"c:\file.ext");


You could always set up strings to hold the information you need as well, such as the bin directory of your Turbo ASM installation or even paths to the files themselves.
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Thu May 15, 2008 11:50 am    Post subject: Reply with quote

i'm having trouble with last line the td.exe one cuz when it execute td it open it on the screen :S
well it actually create the .td file but after that the compiler open and the .exe file isnt created

_________________
Stylo
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Thu May 15, 2008 12:27 pm    Post subject: Reply with quote

Don't do that... you're openning a CMD which calls the APIs, instead calling them directly.

You can create, read and write files using CreateFile, ReadFile and WriteFile, in C# you can simply use System.IO.File, System.IO.Directory, and System.IO.StreamReader and System.IO.StreamWriter classes.
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Thu May 15, 2008 12:58 pm    Post subject: Reply with quote

but i already said that my previous method for this was the system.IO
what i wanna do is openning the cmd directly from my application

_________________
Stylo
Back to top
View user's profile Send private message
Estx
Expert Cheater
Reputation: 0

Joined: 04 Mar 2008
Posts: 172

PostPosted: Thu May 15, 2008 9:34 pm    Post subject: Reply with quote

It would've been because the previous code wasn't giving tASM enough time to do what it needs to.

Code:
Process.Start(@"c:\tasm\bin\tasm.exe", @"/zi c:\file.ext").WaitForExit();
Process.Start(@"c:\tasm\bin\tlink.exe", @"/v c:\file.ext").WaitForExit();
Process.Start(@"c:\tasm\bin\td.exe", @"c:\file.ext").WaitForExit();


That will fix your problem.

Symbol wrote:
Don't do that... you're openning a CMD which calls the APIs, instead calling them directly.

You can create, read and write files using CreateFile, ReadFile and WriteFile, in C# you can simply use System.IO.File, System.IO.Directory, and System.IO.StreamReader and System.IO.StreamWriter classes.

It's not opening the command prompt directly, it's opening the application directly which is console based - hence the opening of the command prompt. I'm sure there are probably dynamic link libraries that tASM uses to compile the files - he could use the exports from them, but that might be beyond his current skill level in C#. I could always be wrong lol.
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Thu May 15, 2008 9:56 pm    Post subject: Reply with quote

still doing the same thing .. in the end of the compile i suppose to end up with 4 files
.obj file .map file . td file and .exe file , all the files besides the .exe file
and the compiler open itself on my screen :\

_________________
Stylo
Back to top
View user's profile Send private message
Estx
Expert Cheater
Reputation: 0

Joined: 04 Mar 2008
Posts: 172

PostPosted: Fri May 16, 2008 9:33 am    Post subject: Reply with quote

1qaz wrote:
still doing the same thing .. in the end of the compile i suppose to end up with 4 files
.obj file .map file . td file and .exe file , all the files besides the .exe file
and the compiler open itself on my screen :\


What happens when you run your batch file using the exact same info as you're parsing through C#?

Once again, I will mention I don't know anything about the Turbo ASM compiler, so if you're not parsing arguments to the applications correctly then all of the help here would be for nothing.

From your previous posts, I'm guessing you're not parsing something to the "td" executable file, that will be why it's displaying itself on the screen and possibly why it is not compiling your executable.
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Fri May 16, 2008 1:59 pm    Post subject: Reply with quote

if you'll execute the tasm.exe and tlink.exe files you'll see the cmd on screen with the arguments you can use with them..
but if you'll execute td.exe file the compiler will open on your screen so i guess there's a diiferent between those files..

btw the .exe file is created, it's the .td file that isn't

_________________
Stylo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites