一、请问如何获取Windows2000的系统盘符?二、假如我要获得以下路径该如何做?(H盘是我的Windows2000系统盘)
H:\Documents and Settings\Administrator\「开始」菜单\程序\启动

解决方案 »

  1.   

    用API
    GetSystemDirectory()检索windows系统文件名;
    我以前用过一个API,好像是获得系统盘府的,不过记不起来了,
    等我找到在给你!
    祝你进步!
      

  2.   

    获得当前用户名
    用GetUserName()
      

  3.   

    以下代码如何修改才能达到我想要的效果?
    char path[MAX_PATH];
             char link[MAX_PATH];
             CShortcut shortcut;
             SHORTCUTSTRUCT strt; memset(path,0,sizeof(path));
    memset(link,0,sizeof(link));

    //GetWindowsDirectory(link,MAX_PATH);
    GetWindowsDirectory(link,MAX_PATH);
    GetCurrentDirectory(MAX_PATH,path);
    wsprintf(link+strlen(link),"%s","\\Start Menu\\Programs\\启动\\定时关机.lnk");
    wsprintf(path+strlen(path),"\\%s.exe",AfxGetApp()->m_pszExeName); strt.nIconIndex = 0;
    strt.nShowCmd = 0;
    strt.wHotkey = MAKEWORD((BYTE) 0, (BYTE) 0);
    strt.strPath = link;
    strt.strTarget = path;
    strt.strArgs = _T("");
    strt.strDescription  = _T("");
    strt.strIconLocation = _T(""); shortcut.CreateEx(&strt);
      

  4.   

    char path[MAX_PATH];使用SHGetFolderPath(NULL,CSIDL_STARTUP ,NULL,SHGFP_TYPE_CURRENT,&path)取得,
    建议在MSDN中查一下这个函数。
      

  5.   

    char buf[60];
    GetSystemDirectory(buf, 60); 
    //本机 buf="C:\winnt\system32"
    //取出冒号前的字符串就可