3

I am trying to use the following script:

E=inputbox("What do you want me to search?")
Set sh = CreateObject("WScript.Shell")
sh.Run "search.exe "+E, 0, True

and for some reason I cannot discern, it will just quit automatically without any error message. The Exe, made in Python has the following script:

import webbrowser as w
e=raw_input()
E=e.replace(" ","+")
print(e+" has been searched.")
w.open("http://stackoverflow.com/search?q="+E)

I assume it's crashing because E=inputbox("What do you want me to search?") has multiple words, but I'm not sure. Any help would be greatly appreciated.

EDIT: When I tried to convert the python file to an exe again in hopes of doing.....ANYTHING good, I saw the following message:

The following modules appear to be missing: ['IronPythonConsole', 'System', 'System.Windows.Forms.Clipboard', '_scproxy', 'clr', 'modes.editingmodes', 'startup']

Any help regarding this too would be very welcome.

Azing
  • 43
  • 4

1 Answers1

0

InputBox Function is ok. Maybe that system can't find your program. For debugging purposes (to see starting directory and all system messages), change run line as follows:

sh.Run "cmd /C search.exe " & E &  " & cd & pause", 1, True

or

sh.Run "cmd /K search.exe " & E, 1, True

Resource: Run Method (Windows Script Host) reference.

JosefZ
  • 28,460
  • 5
  • 44
  • 83
  • I did what you suggested, and I noticed these two things: The exe didn't get the argument passed to it upon launch, for it still required input and the filed was blank, and second, the webbrowser module was not exported to the library for my exe, as shown by the following message: `File "C:\Users\Chinmay\search.py", line 1 import webbrowser as w ImportError: No module named webbrowser` . – Azing Nov 08 '15 at 21:19