You would need to delay your script until after the desktop loads or use run once to load later on. That registry key does not exist during the logon process.