WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Networks - Servers
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Determine if a User has Admin Rights

Keywords:   determine user admin rights

This script assumes that WinNT was installed on a NTFS partition and that the default directory/file permissions have not been altered.
;test for administrator rights
ErrorMode(@off)
a=FileOpen("C:\Winnt\System32\drivers\test.txt", "WRITE")
If a == 0
    Message("Attention!", "You do not have administrator rights to this machine. Installation will not continue.")
    exit
else
	FileWrite(a, "This is a test for administrator rights.")
	FileClose(a)
	FileDelete("C:\Winnt\System32\drivers\test.txt")
endif
ErrorMode(@cancel) 

Article ID:   W14628
Filename:   Determine if a User has Admin Rights.txt
File Created: 2000:11:14:13:15:32
Last Updated: 2000:11:14:13:15:32