Share names
-
I am using NetShareGetInfo and i am getting a NERR_NetNameNotFound.I am using the folder path as the share name e.g "C:\\WINNT\\profiles\\chikomok\\My Documents\\Open_Shares" and the sever is the remote P.C were the program is running Can some please tell me what the problem could be. Kelvin Chikomo
-
I am using NetShareGetInfo and i am getting a NERR_NetNameNotFound.I am using the folder path as the share name e.g "C:\\WINNT\\profiles\\chikomok\\My Documents\\Open_Shares" and the sever is the remote P.C were the program is running Can some please tell me what the problem could be. Kelvin Chikomo
If the share name does not exist, then system will return NERR_NetNameNotFound error message. So please check your share name exactly with the shared device in the server. And also server name should begins with \\. If this parameter is NULL, the local computer is used. best of luck regards Vallikumar A
-
If the share name does not exist, then system will return NERR_NetNameNotFound error message. So please check your share name exactly with the shared device in the server. And also server name should begins with \\. If this parameter is NULL, the local computer is used. best of luck regards Vallikumar A
When i try to use \\. i get an error 53 which i do not know what it means. Any help Here is my code
// test2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "test2.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // The one and only application object CWinApp theApp; using namespace std; void wmain( int argc, TCHAR *lpszArgv[ ]) { PSHARE_INFO_502 BufPtr; NET_API_STATUS res; LPTSTR lpszServer = NULL, lpszShare; // // Check command line arguments. // switch(argc) { case 3: lpszServer = lpszArgv[2]; case 2: lpszShare = lpszArgv[1]; break; default: printf("Usage: NetShareGetInfo sharename \n"); return; } // // Call the NetShareGetInfo function, specifying level 502. // cout<shi502_netname, BufPtr->shi502_path, BufPtr->shi502_current_uses); // // Validate the value of the // shi502_security_descriptor member. // if (IsValidSecurityDescriptor(BufPtr->shi502_security_descriptor)) printf("It has a valid Security Descriptor.\n"); else printf("It does not have a valid Security Descriptor.\n"); // // Free the allocated memory. // NetApiBufferFree(BufPtr); } else { if(res == NERR_NetNameNotFound) cout<<"Netnamenotfound"<
-
If the share name does not exist, then system will return NERR_NetNameNotFound error message. So please check your share name exactly with the shared device in the server. And also server name should begins with \\. If this parameter is NULL, the local computer is used. best of luck regards Vallikumar A
You didn't specify that to which machine have you connected to, so it is throwing that error. Use NetResource structure and WNetAddConnection to open the connection so that you can have access to the shared folders on the remote machine . You can also try and check other return values. Remember WNetAddConnection returns a DWORD value eg ERROR_ACCESS_DENIED etc. Does this solve your problem Wishes Anshuman
-
You didn't specify that to which machine have you connected to, so it is throwing that error. Use NetResource structure and WNetAddConnection to open the connection so that you can have access to the shared folders on the remote machine . You can also try and check other return values. Remember WNetAddConnection returns a DWORD value eg ERROR_ACCESS_DENIED etc. Does this solve your problem Wishes Anshuman
I thought all i had to do was to call the netsharegetinfo method. i am just trying to get information from my computer thats all. The method description says put //. to access shares on the remote machine. I really need to get this going Help please Kelvin Chikomo
-
I thought all i had to do was to call the netsharegetinfo method. i am just trying to get information from my computer thats all. The method description says put //. to access shares on the remote machine. I really need to get this going Help please Kelvin Chikomo
If you want to access the information from your machine then no need to give the share name(Server) with \\. Instead this give NULL. This will get the information from your local machine. regards Vallikumar A
-
If you want to access the information from your machine then no need to give the share name(Server) with \\. Instead this give NULL. This will get the information from your local machine. regards Vallikumar A
-
I thought all i had to do was to call the netsharegetinfo method. i am just trying to get information from my computer thats all. The method description says put //. to access shares on the remote machine. I really need to get this going Help please Kelvin Chikomo
The NetShareGetInfo function retrieves information about a particular shared resource on a server.??To what extent do you want to have the control??. SO if you need the control of the files/folders/printers that are residing on the other machine use NETRESOURCE structure and pass it to WNetAddConnection2 function. This opens the connection and you can get the control to the shared folders. Can you tell me what exactly do you want to do because there are a lot of roads that lead to somewhere from here but that would be useless mentioning here if they are of no use to you Wishes Anshuman
-
The NetShareGetInfo function retrieves information about a particular shared resource on a server.??To what extent do you want to have the control??. SO if you need the control of the files/folders/printers that are residing on the other machine use NETRESOURCE structure and pass it to WNetAddConnection2 function. This opens the connection and you can get the control to the shared folders. Can you tell me what exactly do you want to do because there are a lot of roads that lead to somewhere from here but that would be useless mentioning here if they are of no use to you Wishes Anshuman
I am creating a tool to check the attributes of all the shares on my computer. just my computer. So basically i need to get all the information about the shares on my PC using NetShareGetInfo. So far i have been trying to get info for one specific share but it keeps saying the the shre does not exist(NERR_NetNameNotFound) Thanks for the help hey. Kelvin Chikomo
-
I am creating a tool to check the attributes of all the shares on my computer. just my computer. So basically i need to get all the information about the shares on my PC using NetShareGetInfo. So far i have been trying to get info for one specific share but it keeps saying the the shre does not exist(NERR_NetNameNotFound) Thanks for the help hey. Kelvin Chikomo
kelprinc wrote:
So basically i need to get all the information about the shares on my PC using NetShareGetInfo.
Use
NetShareEnum(NULL, ...)
instead. If you need information about a particular share, useNetShareGetInfo(NULL, _T("NameOfShare"), ...)
.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb