Click here to Skip to main content
15,913,467 members
Home / Discussions / C#
   

C#

 
AnswerRe: To show user's screen resolution ? Pin
Christian Graus13-Nov-07 12:45
protectorChristian Graus13-Nov-07 12:45 
GeneralRe: To show user's screen resolution ? Pin
omegazafer13-Nov-07 12:54
omegazafer13-Nov-07 12:54 
GeneralRe: To show user's screen resolution ? Pin
Christian Graus13-Nov-07 12:58
protectorChristian Graus13-Nov-07 12:58 
GeneralRe: To show user's screen resolution ? Pin
Luc Pattyn13-Nov-07 12:58
sitebuilderLuc Pattyn13-Nov-07 12:58 
GeneralRe: To show user's screen resolution ? Pin
omegazafer13-Nov-07 13:12
omegazafer13-Nov-07 13:12 
AnswerRe: To show user's screen resolution ? Pin
Luc Pattyn13-Nov-07 12:55
sitebuilderLuc Pattyn13-Nov-07 12:55 
GeneralRe: To show user's screen resolution ? Pin
omegazafer13-Nov-07 23:59
omegazafer13-Nov-07 23:59 
Questioncreating Processes to run BAT files using XCOPY Pin
ckelker13-Nov-07 12:30
ckelker13-Nov-07 12:30 
I'm attempting to create an application that can call .BAT files to handle tasks.

The BATCH file runs fine EXCEPT for the XCOPY call. Everyting works from a CMD window. Would .NET not allow an XCOPY execution?

Here's the code that creates the process and the calling code:

public string runProcess(string sCommand, string sArgs, bool bRedirectStandardOutput, bool bUseShellExecute)<br />
{<br />
	Process seiProcess = new Process();<br />
	seiProcess.StartInfo.FileName = sCommand;<br />
	seiProcess.StartInfo.Arguments = sArgs;<br />
	seiProcess.StartInfo.RedirectStandardOutput = bRedirectStandardOutput;<br />
	seiProcess.StartInfo.UseShellExecute = bUseShellExecute;  <br />
        bool bStart = seiProcess.Start();<br />
<br />
        if (bRedirectStandardOutput)<br />
        {<br />
            // Set our event handler to asynchronously read the sort output.<br />
            seiProcess.OutputDataReceived += new DataReceivedEventHandler(SortOutputHandler);<br />
            seiProcess.BeginOutputReadLine();<br />
        }<br />
<br />
	seiProcess.WaitForExit();<br />
        seiProcess.Close();<br />
        return processOutput;<br />
}<br />
<br />
//the calling code<br />
String r = util.runProcess(@"..\copysomething.bat", @"G d:\dvd", true, false);<br />


The batch file that is executed by the .NET app:
<br />
@ECHO OFF<br />
echo STARTING AT<br />
TIME /T<br />
xcopy %1:\* %2<br />



The above BATCH file will display the time correctly, so I know it's getting called!

Thanks in advance,
C
AnswerRe: creating Processes to run BAT files using XCOPY Pin
Dave Kreskowiak14-Nov-07 6:46
mveDave Kreskowiak14-Nov-07 6:46 
GeneralRe: creating Processes to run BAT files using XCOPY Pin
ckelker14-Nov-07 6:58
ckelker14-Nov-07 6:58 
GeneralRe: creating Processes to run BAT files using XCOPY Pin
Dave Kreskowiak14-Nov-07 12:50
mveDave Kreskowiak14-Nov-07 12:50 
GeneralRe: creating Processes to run BAT files using XCOPY Pin
ckelker15-Nov-07 7:31
ckelker15-Nov-07 7:31 
GeneralRe: creating Processes to run BAT files using XCOPY Pin
Dave Kreskowiak15-Nov-07 12:09
mveDave Kreskowiak15-Nov-07 12:09 
QuestionCreateGraphics on a System.Image Pin
codemunkeh13-Nov-07 12:27
codemunkeh13-Nov-07 12:27 
AnswerRe: CreateGraphics on a System.Image Pin
Christian Graus13-Nov-07 12:38
protectorChristian Graus13-Nov-07 12:38 
GeneralRe: CreateGraphics on a System.Image Pin
codemunkeh13-Nov-07 12:50
codemunkeh13-Nov-07 12:50 
GeneralRe: CreateGraphics on a System.Image Pin
Christian Graus13-Nov-07 12:59
protectorChristian Graus13-Nov-07 12:59 
GeneralRe: CreateGraphics on a System.Image Pin
codemunkeh13-Nov-07 13:05
codemunkeh13-Nov-07 13:05 
AnswerRe: CreateGraphics on a System.Image Pin
Luc Pattyn13-Nov-07 13:06
sitebuilderLuc Pattyn13-Nov-07 13:06 
GeneralRe: CreateGraphics on a System.Image Pin
codemunkeh13-Nov-07 13:09
codemunkeh13-Nov-07 13:09 
GeneralRe: CreateGraphics on a System.Image Pin
Luc Pattyn13-Nov-07 13:16
sitebuilderLuc Pattyn13-Nov-07 13:16 
GeneralRe: CreateGraphics on a System.Image Pin
codemunkeh13-Nov-07 13:35
codemunkeh13-Nov-07 13:35 
GeneralRe: CreateGraphics on a System.Image Pin
Luc Pattyn13-Nov-07 13:45
sitebuilderLuc Pattyn13-Nov-07 13:45 
QuestionImages Click Event Problem... Pin
kingletas13-Nov-07 12:01
kingletas13-Nov-07 12:01 
AnswerRe: Images Click Event Problem... Pin
Luc Pattyn13-Nov-07 12:17
sitebuilderLuc Pattyn13-Nov-07 12:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.