Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
481 B

  1. //
  2. // Create the shell object
  3. //
  4. var shell = new ActiveXObject( "WScript.Shell" );
  5. //
  6. // Check the command arguments
  7. //
  8. if( WScript.Arguments.Length < 1 || WScript.Arguments( 0 ) == "/h")
  9. {
  10. WScript.Echo( "regwrite.js <KEYNAME> <KEYVALUE> <KEYTYPE>" );
  11. WScript.Quit();
  12. }
  13. try
  14. {
  15. //
  16. // Write to the registry.
  17. //
  18. shell.RegWrite( WScript.Arguments( 0 ),WScript.Arguments( 1 ),WScript.Arguments( 2 ) );
  19. }
  20. catch( e )
  21. {
  22. WScript.Echo( e.toString() );
  23. }