Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var args = WScript.Arguments;
- if ( args.Unnamed.length != 1 ) {
- WScript.Echo([
- 'Usage: ',
- WScript.ScriptName + ' [/A] path [/S]',
- '',
- '/A - Show Artist Info (by default - Album Info)',
- '/S - Suppress a message if an Info file does not exist',
- ].join('\n'));
- WScript.Quit();
- }
- var fso = new ActiveXObject('Scripting.FileSystemObject');
- var info_file = args.Unnamed.item(0);
- if ( ! fso.FileExists(info_file) ) {
- WScript.Echo('Could not to find the info file: ' + info_file);
- WScript.Quit();
- }
- info_file = fso.GetFile(info_file).ParentFolder;
- if ( args.Named.Exists('A') ) {
- info_file = info_file.ParentFolder;
- }
- info_file += '\\info.txt';
- if ( ! fso.FileExists(info_file) && ! args.Named.Exists('S') ) {
- WScript.Echo('File not found: ' + info_file);
- WScript.Quit();
- }
- var shell = WScript.CreateObject('WScript.Shell');
- shell.Run('notepad.exe "' + info_file + '"', 1, false);
Advertisement
Add Comment
Please, Sign In to add comment