Hi
You got me on the right track there. Thanks
The actual value for mail sound is here:
HKEY_CURRENT_USER\AppEvents\Schemes\Apps.Default\Notification.Mail.Current.
Another misleading fact is that the filename is translated to Swedish, so I didn't find it with a search in the Registry.
This is the new code:
Sub main()
Dim comArgs() As String = Environment.GetCommandLineArgs
For Each comArg In comArgs
If comArg.ToLower.Contains("/on") Then
'Turn on sound
Dim setValue As String = "C:\WINDOWS\media\notify.wav"
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\Notification.Mail\.Current", "", setValue)
Exit For
End If
If comArg.ToLower.Contains("/off") Then
'Torn sound off
Dim setValue As String = ""
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\Notification.Mail\.Current", "", setValue)
Exit For
End If
Next
End Sub
Thanks.