Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9237203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:28:59+00:00 2026-06-18T07:28:59+00:00

am facing two problems one big problem and one small problem :) problem #

  • 0

am facing two problems one big problem and one small problem 🙂
problem # 1 : am unable to read Machine ID from below path … i get my processor name like intel i7 @2.2ghz like that , i do not know why , i should get machine id , long integer string but i not get it , so please help

  reg_path="SOFTWARE\\Microsoft\\Cryptography";    
  rvalue="MachineGuid";  // data value

my registery reading function

   string read_reg_sz(char rpath[],char rdata[])    // read registery Loaction
{
    REGSAM flag = KEY_WOW64_32KEY or KEY_WOW64_64KEY; 
    char buffer[MAX];   
    char Buffer[MAX];
    DWORD BufSize = _MAX_PATH;
    char dwMHz[MAX];
    DWORD dataType = REG_SZ;       
    HKEY hKey;
    long lError = RegOpenKeyEx(HKEY_LOCAL_MACHINE,rpath,NULL, KEY_READ | KEY_WRITE | flag,&hKey);
    if(lError != ERROR_SUCCESS)
      {// if the key is not found, tell the user why:
           FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
                         NULL,
                         lError,
                         0,
                         Buffer,
                         _MAX_PATH,
                         0);
            cout<<"\n reg erro : "<<Buffer;
           return "N/A";
       }
        // query the key:
        RegQueryValueEx(hKey,rdata,NULL,&dataType,(LPBYTE) &dwMHz,&BufSize);
    RegCloseKey(hKey);  // close open handle ....
    cout<<"\n reg data read: "<<dwMHz;
return dwMHz;
}

second problem :
currently i have function which can totally clean recycle bin 🙂

SHEmptyRecycleBin(NULL, NULL, SHERB_NOCONFIRMATION | SHERB_NOPROGRESSUI | SHERB_NOSOUND); 

but i want to delete single file from recycle bin like passing filename

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:29:00+00:00Added an answer on June 18, 2026 at 7:29 am

    You should really post it as two different questions, but I’ll try to answer both.

    1. Get MachineGuid

    I think your issue is in this line:

        // query the key:
        RegQueryValueEx(hKey,rdata,NULL,&dataType,(LPBYTE) &dwMHz,&BufSize);
    

    You should change it to:

        // query the key:
        RegQueryValueEx(hKey,rvalue,NULL,&dataType,(LPBYTE) &dwMHz,&BufSize);
    

    By the way, dhMHz does not sound like right variable name – change it to reflect reality.

    Also, you should have this:

     DWORD BufSize = sizeof(Buffer) - 1;
    

    And, it would be nice to NOT have both buffer and Buffer variables.

    2. Delete one file from recycle bin

    According to Microsoft documentation on SHFileOperation, you should just use DeleteFile on filename like C:\$Recycle.Bin\file.txt:

    • When used to delete a file, SHFileOperation permanently deletes the file unless you set the FOF_ALLOWUNDO flag in the fFlags member of the SHFILEOPSTRUCT structure pointed to by lpFileOp. Setting that flag sends the file to the Recycle Bin. If you want to simply delete a file and guarantee that it is not placed in the Recycle Bin, use DeleteFile.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read some problems from other users facing the same problem, but the solutions
I am facing problem while aligning two text, one in center and other text
I am facing a problem to submit two forms with one JavaScript function. In
i am facing one problem i have two xml files. Plugins.xml <SolutionProfile xmlns=http://schemas.microsoft.com/pag/cab-profile> <Modules>
I am facing problem. I need to build one app in two ways, first
I am facing a rather awkward problem. I register two event handlers, one for
Im facing one problem in streaming data capture for reading the broadcast data during
I'm facing a big problem related to Activity . My scenario is as follows:
I'm facing one of the craziest problems I've ever found in css... I have
I am facing a problem similar to the one described in Invalidating JPA EntityManager

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.