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.

44 lines
942 B

  1. // Sample TBScript using Microsoft JScript
  2. //
  3. // Connects, opens Notepad, closes, and logs off.
  4. // Simply connect using the default data
  5. TS.Connect();
  6. // Wait for the desktop to appear, and give
  7. // several seconds for the session to get started
  8. TS.WaitForTextAndSleep("Recycle Bin", 5000);
  9. // Run notepad
  10. TS.Start("notepad");
  11. // Wait for notpad to come up
  12. TS.WaitForTextAndSleep("Untitled - Notepad", 3000);
  13. // Type some text in notepad
  14. TS.TypeText("Hello, World!\n\nThis is a sample script!");
  15. // Wait a couple seconds
  16. Sleep(3000);
  17. // Open the file menu
  18. TS.KeyAlt('f');
  19. // Wait for Exit to appear
  20. TS.WaitForTextAndSleep("Exit", 750);
  21. // Hit 'x' for Exit
  22. TS.KeyPress('x');
  23. // Wait for the exit confirmation dialog
  24. TS.WaitForTextAndSleep("Do you want to save the changes", 2000);
  25. // Hit no, we don't want to save the changes
  26. TS.KeyPress('n');
  27. Sleep(3000);
  28. // And logoff!
  29. TS.Logoff();