2009-02-05 12 views
145

मैं cmd समझ सकता हूं लेकिन cmd /c नहीं। मैं वर्तमान से एक जावा प्रोग्राम का आह्वान करने की कोशिश कर रहा था जिसके लिए मैं Runtime.getRuntime().exec("cmd /C java helloworld"); का उपयोग करता हूं, मेरा संदेह उठता है।सीएमडी/सी का क्या अर्थ है?

उत्तर

85

/C स्ट्रिंग द्वारा निर्दिष्ट आदेश निकालता है और फिर समाप्त हो जाता है।

आप cmd /? टाइप करके सभी cmd कमांड लाइन स्विच प्राप्त कर सकते हैं।

17
CMD.exe 

Start a new CMD shell 

Syntax 
     CMD [charset] [options] [My_Command] 

Options  

**/C  Carries out My_Command and then 
terminates** 

सहायता से।

184

जिस हिस्से में आपको रुचि होनी चाहिए वह /? भाग है, जो टूल के साथ आपके अन्य प्रश्नों को हल करना चाहिए।

 
Microsoft Windows XP [Version 5.1.2600] 
(C) Copyright 1985-2001 Microsoft Corp. 

C:\>cmd /? 
Starts a new instance of the Windows XP command interpreter 

CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF] 
    [[/S] [/C | /K] string] 

/C  Carries out the command specified by string and then terminates 
/K  Carries out the command specified by string but remains 
/S  Modifies the treatment of string after /C or /K (see below) 
/Q  Turns echo off 
/D  Disable execution of AutoRun commands from registry (see below) 
/A  Causes the output of internal commands to a pipe or file to be ANSI 
/U  Causes the output of internal commands to a pipe or file to be 
     Unicode 
/T:fg Sets the foreground/background colors (see COLOR /? for more info) 
/E:ON Enable command extensions (see below) 
/E:OFF Disable command extensions (see below) 
/F:ON Enable file and directory name completion characters (see below) 
/F:OFF Disable file and directory name completion characters (see below) 
/V:ON Enable delayed environment variable expansion using ! as the 
     delimiter. For example, /V:ON would allow !var! to expand the 
     variable var at execution time. The var syntax expands variables 
     at input time, which is quite a different thing when inside of a FOR 
     loop. 
/V:OFF Disable delayed environment expansion. 
+5

वहाँ उत्पादन के बाद "ठहराव" cmd खिड़की के लिए एक आदेश भी है: "cmd/सी file_name और ठहराव" यह cmd/k – JerryGoyal

+0

यह क्या करता है, तो किसी दिए गए आदेश है कि शुरू होता है एक सर्वर की तरह है से थोड़ा अलग है अपना लूप? क्या हमें/सी या/के उपयोग करना चाहिए? –

+0

'प्रक्रिया' के माध्यम से सी # में कमांड निष्पादित करते समय विंडोज 7 या विंडोज सर्वर 2008 आर 2 ऑपरेटिंग सिस्टम में अनिवार्य/सी अनिवार्य है? –

संबंधित मुद्दे