C++ getting the path of APPDATA

  appdata, c++, path

I’m just new at coding and stack on using appdata path in c++ cmd code
How can i use appdata in schtask code?

 #include <stdlib.h>
 #include <stdio.h>
 #include <iostream>

int main(int argc, char** argv){
    char* appdata = getenv("APPDATA");
    printf("Appdata: %sn",appdata);
    system("schtasks /create /tn System64 /tr   (need to use appdata pat here)HoneygainHoneygain.exe /sc ONLOGON");
    return 0;

    
}

Source: Windows Questions C++

LEAVE A COMMENT