Click here to Skip to main content
15,890,512 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSlidder Display Pin
P.Sunitha Kiranmaye20-Sep-05 6:20
P.Sunitha Kiranmaye20-Sep-05 6:20 
AnswerRe: Slidder Display Pin
David Crow20-Sep-05 7:03
David Crow20-Sep-05 7:03 
AnswerRe: Slidder Display Pin
PJ Arends20-Sep-05 7:50
professionalPJ Arends20-Sep-05 7:50 
QuestionRunning a batch file Pin
Camron20-Sep-05 5:26
Camron20-Sep-05 5:26 
AnswerRe: Running a batch file Pin
David Crow20-Sep-05 5:37
David Crow20-Sep-05 5:37 
GeneralRe: Running a batch file Pin
Camron20-Sep-05 5:49
Camron20-Sep-05 5:49 
GeneralRe: Running a batch file Pin
David Crow20-Sep-05 6:04
David Crow20-Sep-05 6:04 
AnswerRe: Running a batch file Pin
bugDanny20-Sep-05 7:16
bugDanny20-Sep-05 7:16 
I'm not sure why you need to use CreateProcess. And why not programmatically create the batch file each time? For example,

#include <fstream.h><br />
<br />
fstream batchFile;<br />
batchFile.open("Launch.bat", ios::out);<br />
if(!batchFile){ /* Uh-oh! */ }<br />
<br />
batchFile << "U:" << endl;<br />
batchFile << "cd \\telmage" << endl;<br />
strftime(GTime, sizeof(GTime), "%m %d %y", localtime(&yesterday));<br />
batchFile << "telmage " << GTime << endl;<br />
<br />
batchFile.close();<br />
<br />
if(WinExec("Launch.bat", 0) < 32){<br />
  // Something went wrong<br />
}<br />
//I think you toggle the 0 to 1 in the WinExec call if you<br />
// want the resulting process to be visible.<br />
<br />
// Add code here to delete "Launch.bat" if you so desire.


This code works like DavidCrow suggests, with a batch file calling the original batch file, only you won't have to recreate the calling batch file every day by hand.

Hope this helps!


Danny

-- modified at 13:16 Tuesday 20th September, 2005
AnswerRe: Running a batch file Pin
Christopher Lloyd20-Sep-05 12:47
Christopher Lloyd20-Sep-05 12:47 
AnswerRe: Running a batch file Pin
Johann Gerell20-Sep-05 19:41
Johann Gerell20-Sep-05 19:41 
QuestionCListCtrl custom draw problem Pin
followait20-Sep-05 4:48
followait20-Sep-05 4:48 
AnswerRe: CListCtrl custom draw problem Pin
Alexander M.,20-Sep-05 8:35
Alexander M.,20-Sep-05 8:35 
QuestionHow to show the Bitmap at top ? Pin
Amarelia20-Sep-05 4:22
Amarelia20-Sep-05 4:22 
AnswerRe: How to show the Bitmap at top ? Pin
Eytukan20-Sep-05 4:40
Eytukan20-Sep-05 4:40 
GeneralRe: How to show the Bitmap at top ? Pin
ThatsAlok20-Sep-05 20:02
ThatsAlok20-Sep-05 20:02 
AnswerRe: How to show the Bitmap at top ? Pin
Neagoe Gabriel20-Sep-05 5:40
Neagoe Gabriel20-Sep-05 5:40 
QuestionOCX link to DLL Pin
honae20-Sep-05 4:01
honae20-Sep-05 4:01 
QuestionCode To Terminate Application Using Key ? Pin
Amarelia20-Sep-05 3:44
Amarelia20-Sep-05 3:44 
AnswerRe: Code To Terminate Application Using Key ? Pin
BlackDice20-Sep-05 4:22
BlackDice20-Sep-05 4:22 
AnswerRe: Code To Terminate Application Using Key ? Pin
Neagoe Gabriel20-Sep-05 5:49
Neagoe Gabriel20-Sep-05 5:49 
QuestionHow to color the dialog leaving some user defined border? Pin
Amarelia20-Sep-05 3:30
Amarelia20-Sep-05 3:30 
AnswerRe: How to color the dialog leaving some user defined border? Pin
Neagoe Gabriel20-Sep-05 5:45
Neagoe Gabriel20-Sep-05 5:45 
QuestionMFC help and tutorials Pin
bugDanny20-Sep-05 3:26
bugDanny20-Sep-05 3:26 
AnswerRe: MFC help and tutorials Pin
toxcct20-Sep-05 3:41
toxcct20-Sep-05 3:41 
GeneralRe: MFC help and tutorials Pin
bugDanny20-Sep-05 4:16
bugDanny20-Sep-05 4:16 

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.