autoexecution in Windows

F

F. Petitjean

Le Mon, 07 Mar 2005 13:25:35 -0700, Earl Eiland a écrit :
How does one make a Python program auto-execute in Windows?

Earl
write a virus ? :)

What do you mean by « auto-execute » ?

Regards
 
E

Earl Eiland

In Linux, if I make the first line #!/path/to/Python, all I have to do
to execute the program is type ./FileName (assuming my pwd is the same
as FileName). what's the Windows equivalent?
Earl
 
R

rbt

Earl said:
How does one make a Python program auto-execute in Windows?

Earl

No program (python or other) can just arbitrarily execute. A user has to
click it or a cron-like utility (Task Scheduler) has to execute it at a
set time. registry entries (such as run) can execute programs too. Also,
proper Windows services can be configured to start at boot.

Again, nothing can just arbitrarily execute. If it could, viruses would
be a *nightmare*
 
R

rbt

Earl said:
In Linux, if I make the first line #!/path/to/Python, all I have to do
to execute the program is type ./FileName (assuming my pwd is the same
as FileName). what's the Windows equivalent?
Earl

Look at the 'pathext' variable under the system's environmental
variables. Add .py and .pyw to that and you're good to go.
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Earl said:
How does one make a Python program auto-execute in Windows?

Use any of the mechanisms to make an arbitrary program auto-execute
(do you want on boot, on login, or what?), and use
c:\pythonXY\python.exe as the executable name; use the script name
as the first argument.

Regards,
Martin
 
B

Bill

Earl said:
How does one make a Python program auto-execute in Windows?

Earl

You need to have files with .py or .pyo or .py registered to open with
the python interpreter. In Windows Explorer, choose the menu item
Tools->Folder Options and select the File Types tab to see how
registered file types are set up.

On my system, for the extension .py, the "open" action has an
application string of C:\Python23\python.exe "%1" %*. For .pyw files
it's C:\Python23\pythonw.exe "%1" %*.

I can double click on a .py file and it executes, or use the command
prompt.

I believe if you install the Activestate distribution it sets up the
file registrations automatically.

Bill
 
P

Peter Hansen

Bill said:
I can double click on a .py file and it executes, or use the command
prompt.

I believe if you install the Activestate distribution it sets up the
file registrations automatically.

As does the standard Windows distribution from python.org.

-Peter
 
T

Thorsten Kampe

Look at the 'pathext' variable under the system's environmental
variables. Add .py and .pyw to that and you're good to go.

No, that's just so you can omit the extension.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,222
Messages
2,571,142
Members
47,756
Latest member
JulienneY0

Latest Threads

Top