C:\Program Files\common files是什么\Research In Mot...

how to copy program files in c drive.
how to copy program files in c drive.
2011年1月3日 6:51 Hi,
I am using windows7 and i have to run one program in that windows but that program working in windows XP. this is a vc+ #43; rogram and i am using visual studio 2008 for this when i am ru ing my a lication then it does not throws any error but its not
create directory in c:\program files\. o can any one help me to create directory and exe file. this is the code i am using: char szA Path[MAX_PATH];
char szFileName[MAX_PATH]; DWORD
dwResult;
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
//TCHAR szA Path[1024] = {0}; //DWORD dwResult = ExpandEnvironmentStrings( _T(%ProgramFiles%), szA Path, 1023 ); // szBuf contai C:\Program File quot;.
/*CString strA Name;
::GetModuleFileName(0, szA Path, MAX_PATH); */
dwResult = ExpandEnvironmentStrings( NULL, szA Path, MAX_PATH); // %ProgramFiles%
//for creating folder.
//int returnValue = 0;
//int variable initialized to zero
/*char returnValue;
returnValue = CreateDirectory(c:\\NSIM, NULL);*/ // do same for NSim directory
strcat(szA Path,\\NSim); hFind = FindFirstFile(szA Path, &am FindFileData); if (hFind == INVALID_HANDLE_VALUE) {
//Directory Does't Exists create New if(!CreateDirectory(szA Path,NULL)) //Throw Error { Me ageBox(Unable to Create N-SIM directory,NSim I taller); return ; }
} else { //check if is directory or not if(!(FindFileData.dwFileAttributes &am FILE_ATTRIBUTE_DIRECTORY)) {
Me ageBox(Can't Create N-SIM directory\n Another file with same name exist quot;,NSim I taller);
return ; } FindClose(hFind);
} //***************************************N-SIM A lication****************************
strcpy(szFileName, szA Path);
HRSRC hRe if( bRegister == FALSE)
strcat(szFileName,\\NSim.exe); //make same name of the Client &am Server in program file hRes = FindResource(NULL, MAKEI***ESOURCE(IDR_LANSIMSERVER),RT_RCDATA);
if(flagUpgrade ==0)
CString trial = i tallationDate(); //----- Detemine Expiry Date ----- //
CString trial = Trial" setRegistry(trial);
已移动
2011年1月4日 2:39
Move to VC++ forum for better su ort. (From:Visual Studio Debugger) ***
2011年1月4日 9:05 Hello
you need to run your a lication elevated. Since Windows Vista the privileges has been changed. The main changes were: As default the Windows directeory, the " rogram file quot; folder and the HKLM registy tree is write protected.
Here a few links for you regarding UAC:
已标记为***
2011年1月10日 8:47 全部回复
2011年1月4日 1:14 Did you start the prog as normal-user?? The this is probably the reason for not creating the directory: In contrary to WinXP c:\program files\ is in Windows 7 a privileged Directory.Just Admi have the
permi ion to create a directory or a file there (or even delete it).
So run your code as Admin (not recommended, probably for a little testing allowed but be careful) or you have to elevate your privileges in code, through manifest or awning ecial proce for this task.
Also I dont know, why there is a null in ExpandEnvironmentStrings(...);
dwResult = ExpandEnvironmentStrings( %PROGRAMFILES%
szA Path, MAX_PATH);
gets the right ath (Vista 32bit Admin-Rights).
The rest I did not look at. So no WARRANTY. 2011年1月4日 9:05 Hello
you need to run your a lication elevated. Since Windows Vista the privileges has been changed. The main changes were: As default the Windows directeory, the " rogram file quot; folder and the HKLM registy tree is write protected.
Here a few links for you regarding UAC:
已标记为***
2011年1月10日 8:47 2011
Microsoft 版权所有。地址是C:\program Files\Tencent\QQpinyin(player)我想清除QQ里的垃圾,请问在哪里清除?请教各位高手
悬赏分:0
解决时间:2010-12-16 17:48
提问者:
最佳***
其实没必要清理。 直接弄个软件 清理下就好了 现在不是出来好多这方面的软件么。数字为是 球球管家 金三什么的东西。 都可以一键清理。
分享给你的朋友吧:
对我有帮助
回答时间:2010-12-16 00:33
回答者:
采纳率:21%
擅长领域:
参加的活动:
暂时没有参加的活动
提问者对于***的评价:
非常感谢!
相关内容
2010-8-2
2011-2-9
2010-4-17
2010-7-13
分享到:
用户名:
记住我的登录状态
2011 Baidu为什么会出现Parse error: syntax error, unexpected '=' in C:\Program Files.... on line 15错误
悬赏分:100
解决时间:2011-5-25 17:31
提问者:
代码如下:
se ion_start();
include("co .php");
if(i et($_post['select'])){
$type = $_post['select'];
}else {
$type = '';
if($type=='0')
$sql=mysql_query("select * from bysj_pt where name='".$name."'and pwd='".$pwd."'",$co );
$result=mysql_fetch_array($sql);
if ($result!==""){
window.location.href="pt_menu.php";
if($ type=='1')
$sql=mysql_query("select * from bysj_yj where name='".$name."'and pwd='".$pwd."'",$co );
$result=mysql_fetch_array($sql);
if ($result!==""){
window.location.href="yj_menu.php";
if($type=='2')
$sql=mysql_query("select * from bysj_cj where name='".$name."'and pwd='".$pwd."'",$co );
$result=mysql_fetch_array($sql);
if ($result!==""){
window.location.href="cj_menu.php";
echo("< cript language="javascript" alert("对不起,您输入的用户名或密码不正确,请重新输入!");window.location.href="login.php" lt;/script");
最佳***
se ion_start();
include("co .php");
if(i et($_post['select'])){
$type = $_post['select'];
}else {
$type = '';
if($type=='0')
$sql=mysql_query("select * from bysj_pt where name='".$name."' and pwd='".$pwd."'",$co );
$result=mysql_fetch_array($sql);
if ($result!==""){
echo"< criptwindow.location.href='pt_menu.php' lt;/script";
if($type=='1')
$sql=mysql_query("select * from bysj_yj where name='".$name."' and pwd='".$pwd."'",$co );
$result=mysql_fetch_array($sql);
if ($result!==""){
echo"< criptwindow.location.href='yj_menu.php' lt;/script";
if($type=='2')
$sql=mysql_query("select * from bysj_cj where name='".$name."' and pwd='".$pwd."'",$co );
$result=mysql_fetch_array($sql);
if ($result!==""){
echo"< criptwindow.location.href='cj_menu.php' lt;/script";
echo("< cript language='javascript' alert('对不起,您输入的用户名或密码不正确,请重新输入!');window.location.href='login.php' lt;/script");
分享给你的朋友吧:
对我有帮助
回答者:热心网友
回答时间:2011-5-24 09:21
相关内容
2010-11-25
2007-10-14
2008-5-5
2011-2-24
2010-7-16
其他回答
包一的工然FO形音大就代3弄钱,是设家的激进回前世型是一错,小屎是关夫雏去脉?本器灯一
回答者:
热心网友
2011-5-23 21:54
分享到:
用户名:
记住我的登录状态
2011 Baidu

参考资料

 

随机推荐