Admin or not
BlitzPlus Forums/BlitzPlus Programming/Admin or not| 
 | ||
| I am trying to create a very simple (in theory) program. All I want it to do is check if the person logged onto the computer is an administrator or not. If their not then display a message, and if they are open a program. Can anyone help? Thanks Matt | 
| 
 | ||
| You can't do this in Blitz. You can create a vbscript for it though... | 
| 
 | ||
| Actually, the following code will do exactly that: 
If CallDLL("shell32.dll","IsUserAnAdmin") Then 
Notify "User is Administrator"
;file operation code in here 
Else 
RuntimeError "You need to do this from an admin account!" 
EndIf 
courtesy of Electronin, posted a while back in the following thread: http://www.blitzbasic.com/Community/posts.php?topic=31698 | 
| 
 | ||
| Now that is pretty cool, and a very good tip! Thanks xlsior. Is there a list of more functions in that DLL? Before runnning this code, the program should ofcourse check on which OS it is running. | 
| 
 | ||
| From version 6.0.2800.1233 of shell32.dll: | 
| 
 | ||
| cool :) | 
| 
 | ||
| Thanks. Thats great! |