mcp-windows-screenshots
Version:
MCP server for accessing Windows screenshots from WSL2
45 lines (41 loc) • 1.32 kB
JavaScript
import { spawnSync, execSync } from 'child_process';
console.log('=== Simple Registry Test ===\n');
// Test 1: Without shell option
console.log('Test 1: spawnSync without shell');
const test1 = spawnSync('reg.exe', [
'query',
'HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders',
'/v',
'{B7BEDE81-DF94-4682-A7D8-57A52620B86F}'
], {
encoding: 'utf8'
});
console.log('Status:', test1.status);
console.log('Output:', test1.stdout ? 'Found' : 'None');
if (test1.stdout && test1.stdout.includes('B7BEDE81')) {
console.log('✅ SUCCESS - Found Screenshots path');
const lines = test1.stdout.split('\n');
for (const line of lines) {
if (line.includes('B7BEDE81')) {
console.log(line.trim());
}
}
}
if (test1.stderr) console.log('Error:', test1.stderr);
// Test 2: Using execSync
console.log('\nTest 2: execSync');
try {
const output = execSync('reg query "HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders" /v "{B7BEDE81-DF94-4682-A7D8-57A52620B86F}"', {
encoding: 'utf8'
});
console.log('✅ SUCCESS');
const lines = output.split('\n');
for (const line of lines) {
if (line.includes('B7BEDE81')) {
console.log(line.trim());
}
}
} catch (e) {
console.log('❌ FAILED:', e.message);
}