Go Back   RunUO - Ultima Online Emulation > Developer's Corner > Programming > C#

C# C# Discussion

Reply
 
Thread Tools Display Modes
Old 09-14-2007, 10:06 PM   #1 (permalink)
Newbie
 
Imperceptus's Avatar
 
Join Date: Oct 2004
Location: Walker, Louisiana
Age: 27
Posts: 65
Send a message via AIM to Imperceptus Send a message via MSN to Imperceptus Send a message via Yahoo to Imperceptus
Default Shell Cmd in Console

I was playing around and decided to try the following code.

Shell("cmd")

in a console app , it lets me perform maybe 1 command at best then im back in the console of my project. Any Idea's how to not auto-magically exit?
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Imperceptus is offline   Reply With Quote
Old 09-15-2007, 01:53 PM   #2 (permalink)
Forum Expert
 
aj9251's Avatar
 
Join Date: Nov 2006
Location: Canada
Age: 21
Posts: 402
Default

Perhaps you could post the script so we can better help you
__________________
The Darkness (Not Launched Yet)
Ziggy: Owner/Founder
aj9251 is offline   Reply With Quote
Old 09-17-2007, 02:59 AM   #3 (permalink)
Forum Expert
 
Join Date: Sep 2002
Age: 23
Posts: 1,472
Default

Quote:
Originally Posted by Imperceptus View Post
I was playing around and decided to try the following code.

Shell("cmd")

in a console app , it lets me perform maybe 1 command at best then im back in the console of my project. Any Idea's how to not auto-magically exit?
not sure where you're getting the "Shell" method.. but adding the argument '/k' this should/might work..

Code:
Shell("cmd /k command_name_here");

//Example:

Shell("cmd /k ping google.com");
The above should ping google.com and then leave the console window open.
Ravatar is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5