Cause
This error occurs when a registry scanning report is viewed before a scan has been executed.
After adding a new registry key for custom registry scanning, the required scan data does not yet exist in the database. If you attempt to open the report at this point, Lansweeper cannot populate the report variables and returns the following error:
Must declare the scalar variable "@vn"
Resolution
To resolve the issue, ensure that registry scanning is properly configured and that a scan has been completed before viewing the report.
-
Configure registry scanning
Follow the steps in this KB article to correctly set up custom registry scanning:
https://community.lansweeper.com/t5/scanning-your-network/scan-registry-values-with-custom-registry-...
-
Rescan the affected Windows computers
- Go to Assets section in the Lansweeper web console.
- Select the relevant Windows computers by checking the checkboxes in front of them.
- Click Rescan to initiate a new scan.
-
View the registry scan results
- Navigate to Scanning > File & Registry Scanning.
- Click Report to view the scan results.
Important note
If you attempt to view the report under Scanning > File & Registry Scanning before rescanning the assets, the error “Must declare the scalar variable '@vn'” will occur.