Greetings to all,
is there a programmatic (and preferably an easy) way to prevent user running executable from network share? It's all fun and games when there is a classic network path (starting with "\\"), but what about network drives?
TIA!
Bruno
Prevent executable running from network share
-
NEW NicknameFJ
- New User

- Posts: 6
- Joined: Fri Sep 04, 2015 8:32 pm
Re: Prevent executable running from network share
Hello bbanelli,
give GetDriveType_() from the WinApi a chance
Look here: https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
Greetings
NicknameFJ
give GetDriveType_() from the WinApi a chance
Look here: https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
Code: Select all
StartDrive$ = Left(ProgramFilename(),1)
If GetDriveType_(StartDrive$+":\") <> #DRIVE_FIXED
MessageRequester("STOP","Can´t start program from this device")
End
EndIf
Greetings
NicknameFJ
Re: Prevent executable running from network share
Thank you so much, exactly what I needed!NEW NicknameFJ wrote:Hello bbanelli,
give GetDriveType_() from the WinApi a chance
