May 22nd, 2009, 09:31 AM
#1
Can System XCopy source paths from textboxes?
Hi, can someone help?
A Typical xcopy:
System("xcopy /y /s /e /f source path destination path").
Is it possible for the xcopy to locate the source path and destination path from
a text box within the same form?
The form has two folderbrowserdialogs which paste the paths selected into
two textboxes. source being textBox1 and destination being textBox2.
I thought it would be a simple case of naming the textboxes in place of source
and destination.
For example:
System("xcopy /y /s /e /f textBox1 textBox2");
I also tried:
System("xcopy /y /s /e /f textBox1.Text textBox2.Text");
However, they don't work, but don't report any errors either.
can someone suggest something?
I can't seem to find the answer browsing the internet.
Thanks
OMEGA
May 22nd, 2009, 09:43 AM
#2
Re: Can System XCopy source paths from textboxes?
In the case of MFC:
Code:
CString strSystem;
CString strSource;
CString strDestination;
textBox1.GetWindowText(strSource);
textBox2.GetWindowText(strDestination);
strSystem.Format(_T("xcopy /y /s /e /f %s %s"), strSource, strDestination);
System(strSystem);
Victor Nijegorodov
May 22nd, 2009, 10:27 AM
#3
Re: Can System XCopy source paths from textboxes?
Thanks for the reply VictorN,
That looked perfect for the job.
Unfortunately i'm using the free edition of visual c++ 2008 express.
The Microsoft Foundation Class library isn't included.
do you know of an alternative?
Thanks
OMEGA
May 22nd, 2009, 10:31 AM
#4
Re: Can System XCopy source paths from textboxes?
Use TCHAR[MAX_PATH] character arrays to get texts from controls and _stprintf to format the System string.
Victor Nijegorodov
Tags for this Thread
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width
Bookmarks