gaurav mahor
gaurav mahor

Reputation: 11

SetVolumeLabel function getting failed due to access denied error on Windows 7

SetVolumeLabel function getting failed due to access denied error on Windows 7.

Same function works fine on Windows XP.

Any idea why this problem is coming on Windows 7 and not on XP.

Any help would be appreciated and very helpful to us.

Upvotes: 1

Views: 248

Answers (1)

Steve
Steve

Reputation: 7271

Windows Vista and Windows 7 have a User Account Control, or UAC. This means that users do not have administrator privileges unless requested for a specific operation or application. Under Windows XP if a user is an administrator, all programs run with administrator privileges.

The error you are getting indicates that SetVolumeLabel requires elevated privileges. You can use "runas" to run the application as an administrator or you can change you program to request elevation.

Upvotes: 1

Related Questions