CodedK
asked on
Create a folder and make it 'shared'.
Hi.
I'd like some code to create a folder ... if it doesnt exist allready...
and then make it shared to everybody.
Thanks in advance.
I'd like some code to create a folder ... if it doesnt exist allready...
and then make it shared to everybody.
Thanks in advance.
>>if will create it if it doesn't exist
IT will create it if it doesn't exist
IT will create it if it doesn't exist
for sharing use NetShareAdd, see here:
https://www.experts-exchange.com/questions/10167039/Desharing-Sharing-Folders.html
quote:
You need to use the NetShareAdd( ) and the NestShareSetInfo API calls...
The win32.hlp says NetShareAdd( ) does not work in win 9.* but it actully does...
example
var
Buff: array [0..MAX_PATH] of char;
begin
NetShareAdd('YourMachineNa me', 502, Buff, 0 or nil); NetShareSetInfo('YourMachi neName', 'SharedAsName', 1501, Buff, 0 or nil);
end;
https://www.experts-exchange.com/questions/10167039/Desharing-Sharing-Folders.html
quote:
You need to use the NetShareAdd( ) and the NestShareSetInfo API calls...
The win32.hlp says NetShareAdd( ) does not work in win 9.* but it actully does...
example
var
Buff: array [0..MAX_PATH] of char;
begin
NetShareAdd('YourMachineNa
end;
ASKER
Thank u BlackTigerX, I'll check it and i ll post. :)
ASKER
Undeclared udentifier...
Should i add something in uses ?
Should i add something in uses ?
ASKER
BlackTigerX :/
I just took a look at the paq questions of other experts... Most of them had the same problem with this code...
Can u test it to see if it works or what is missing ?
I just took a look at the paq questions of other experts... Most of them had the same problem with this code...
Can u test it to see if it works or what is missing ?
is probably not in any of the units that comes with Delphi, but it is on the JEDIs API translation, in the JwaLmShare.pas unit
function NetShareAdd(servername: LMSTR; level: DWORD; buf: LPBYTE; parm_err: LPDWORD): NET_API_STATUS; stdcall;
function NetShareAdd(servername: LMSTR; level: DWORD; buf: LPBYTE; parm_err: LPDWORD): NET_API_STATUS; stdcall;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank u blackTiger :)
ForceDirectories('YourDire
if will create it if it doesn't exist