Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

%1 is not a valid Win32 application?

 
   Web Hosting and Web Master Forums (Home) -> IIS RSS
Next:  [DBMSSOCN] General Network Error  
Author Message
mark_space44

External


Since: Oct 09, 2003
Posts: 4



(Msg. 1) Posted: Thu Oct 09, 2003 7:35 pm
Post subject: %1 is not a valid Win32 application?
Archived from groups: microsoft>public>inetserver>iis, others (more info?)

Hi all, I followed some simple instructions to add python scrips to IIS
as a cgi. The instructions were here:

http://www.e-coli.net/pyiis.html

Unfortunately, when I try to run a test script, I get this message
displayed on my browser window:

%1 is not a valid Win32 application.

That's it! No 500 error, nothing else. I'm not sure what is generating
this message so I'm asking various groups here what might be the issue.

I'm totally at a loss how to move forward. Anyone know? I'll even take
vague suggestions at this point. Wink

Is this error message comming from IIS or is it possibly python? Note
my python instal seems to work ok (runs from command line just fine,
etc.) The test app I'm using (named test.cgi) right now is in a
directory that's already been linked to an IIS virtual directory, from
which I can run ASP scripts just fine. Permissions and ownership should
all be the same. (The permissions on the virtual directory from IIS are
Scrips and Executeables). The test script is here, should you care:

print "Content-type: text/html\n"
print "<h3>Hello World!</h3>"
print "<p>"
print "Well this is just a basic test, mkay?"
print "If this had been a real test there would have been lots more
here, mkay?"

 >> Stay informed about: %1 is not a valid Win32 application? 
Back to top
Login to vote
jerryiii

External


Since: Aug 26, 2003
Posts: 171



(Msg. 2) Posted: Thu Oct 09, 2003 10:17 pm
Post subject: Re: %1 is not a valid Win32 application? [Login to view extended thread Info.]
Archived from groups: microsoft>public>inetserver>iis (more info?)

So this is happening on Windows 2000 Professional?

Jerry

"Mark Space" <mark_space44.TakeThisOut@hotmail.com> wrote in message
news:vobrg1rkf6d114@corp.supernews.com...
 > Hi all, I followed some simple instructions to add python scrips to IIS
 > as a cgi. The instructions were here:
 >
<font color=purple> > <a style='text-decoration: underline;' href="http://www.e-coli.net/pyiis.html</font" target="_blank">http://www.e-coli.net/pyiis.html</font</a>>
 >
 > Unfortunately, when I try to run a test script, I get this message
 > displayed on my browser window:
 >
 > %1 is not a valid Win32 application.
 >
 > That's it! No 500 error, nothing else. I'm not sure what is generating
 > this message so I'm asking various groups here what might be the issue.
 >
 > I'm totally at a loss how to move forward. Anyone know? I'll even take
 > vague suggestions at this point. Wink
 >
 > Is this error message comming from IIS or is it possibly python? Note
 > my python instal seems to work ok (runs from command line just fine,
 > etc.) The test app I'm using (named test.cgi) right now is in a
 > directory that's already been linked to an IIS virtual directory, from
 > which I can run ASP scripts just fine. Permissions and ownership should
 > all be the same. (The permissions on the virtual directory from IIS are
 > Scrips and Executeables). The test script is here, should you care:
 >
 > print "Content-type: text/html\n"
 > print "<h3>Hello World!</h3>"
 > print "<p>"
 > print "Well this is just a basic test, mkay?"
 > print "If this had been a real test there would have been lots more
 > here, mkay?"
 >
 >
 >
 >
 ><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: %1 is not a valid Win32 application? 
Back to top
Login to vote
mark_space44

External


Since: Oct 09, 2003
Posts: 4



(Msg. 3) Posted: Thu Oct 09, 2003 10:22 pm
Post subject: Re: %1 is not a valid Win32 application? [Login to view extended thread Info.]
Archived from groups: microsoft>public>inetserver>iis, others (more info?)

Just a quick update:

I decided to rename the extension for python scripts ".pycgi". Ok, so
when I did so, I decided to test. Result: with .pycgi in the IIS Admin
properties, test.cgi STILL returns "%1 is not a valid Win32
application." Wow. So it's like IIS is ignoring the .cgi rule I added
somehow.

Second, once I renamed test.cgi to test.pycgi, the file time is totally
unrecognized. My browser (Mozilla) declares the type of test.pycgi to
be unrecognized and askes me if I want to download instead. I even
added the .pycgi rule to the vitual directory where the script lives and
I get the same result.

Help!
 >> Stay informed about: %1 is not a valid Win32 application? 
Back to top
Login to vote
mark_space44

External


Since: Oct 09, 2003
Posts: 4



(Msg. 4) Posted: Thu Oct 09, 2003 10:56 pm
Post subject: Re: %1 is not a valid Win32 application? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Update #2:

Renamed the extension yet again, this time to .py. Mozilla seems to
recognize this as a text file and displays it, but IIS still doesn't
seem to catch the .py rule I added to the IIS Admin properties. The
script is still not being executed.

Win2K Pro, IIS 5.0. SP4 and current on all updates.

Man I hope someone can help, I'm really lost here. I think I'll try to
add perl as a script just to see if I can get it to work.
 >> Stay informed about: %1 is not a valid Win32 application? 
Back to top
Login to vote
mark_space44

External


Since: Oct 09, 2003
Posts: 4



(Msg. 5) Posted: Fri Oct 10, 2003 12:07 am
Post subject: Re: %1 is not a valid Win32 application? Atgh! [Login to view extended thread Info.]
Archived from groups: microsoft>public>inetserver>iis (more info?)

Argh. Well I found it but I'm not happy.

1. Adding a script to IIS Admin does NOT add the defintition for the
whole server. I had to add it to the virtual directory, and since I have
to add it to EVERY virtual directory (it appears) I am unhappy with IIS 5.0

2. There was a SECOND problem where a script executed by IIS would be
passed parameters like:

d:\Python23\python.exe D:\Documents and Settings\mark\Web\test.py

which of course the python.exe sees as THREE PARAMETERS!!!

AAAAAAAARRRRRRRRRRRRGGGGGGGGGGGGGGGGHHHHHHHHHHHHHH!!!!!11!!!ELEVEN

Dear folks at MS, this sucks. I can't control this. Unless you want to
make spaces in filenames illegal (fat chance), you have to help me out
when there are spaces in the SINGLE PARAMETER that YOU pass to me.

I can fix this with setting the script path in IIS to:
d:\Python23\python.exe "%s" %s

Notice the quotes around the first %s parameter. This works but is it
garanteed? What about the second parameter, will there be an case where
it fails for lack of quotes?

I feel that if IIS is passing a path, and it's got spaces, then IIS
ought to add the quotes on it's own. Seriously. What command could
possibly tell that those three things on the command line are really
supposed to be one? Only IIS knows this (or any caller, but here we are
discussing IIS).

Please add the quotes guys. Seriously: who do I submit a bug report to?
This needs to be changed.


Ok. Whew. Rant off, thanks for listening.
 >> Stay informed about: %1 is not a valid Win32 application? 
Back to top
Login to vote
someone9

External


Since: Aug 25, 2003
Posts: 2419



(Msg. 6) Posted: Fri Oct 10, 2003 1:05 am
Post subject: Re: %1 is not a valid Win32 application? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Add a Application Extension of ".py" (or .pycgi, or .cgi -- it does not
matter to IIS) and for the ScriptEngine, give:
<full path to PYTHON.EXE> "%s" "%s"

..cgi, .dll, .exe, and .com are special extensions that IIS recognize and try
to execute. If you add an Application Extension that overrides these
extensions, IIS will treat them however you overrode it.

I suggest that you use ISAPI (DLL) versions of a ScriptEngine on IIS instead
of the CGI (EXE) version -- it'll most likely perform better as well as give
500 errors with Win32 error messages instead of a generic "%1 is not a valid
Win32 application".

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Mark Space" <mark_space44.DeleteThis@hotmail.com> wrote in message
news:voc786o8hfmlb0@corp.supernews.com...
Update #2:

Renamed the extension yet again, this time to .py. Mozilla seems to
recognize this as a text file and displays it, but IIS still doesn't
seem to catch the .py rule I added to the IIS Admin properties. The
script is still not being executed.

Win2K Pro, IIS 5.0. SP4 and current on all updates.

Man I hope someone can help, I'm really lost here. I think I'll try to
add perl as a script just to see if I can get it to work.
 >> Stay informed about: %1 is not a valid Win32 application? 
Back to top
Login to vote
someone9

External


Since: Aug 25, 2003
Posts: 2419



(Msg. 7) Posted: Fri Oct 10, 2003 2:44 am
Post subject: Re: %1 is not a valid Win32 application? Atgh! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 > 1. Adding a script to IIS Admin does NOT add the defintition for the
 > whole server. I had to add it to the virtual directory, and since I have
 > to add it to EVERY virtual directory (it appears) I am unhappy with IIS
5.0

No, I think you have it misconfigured. IIS has an inheritance hierarchy for
configuration values -- values set at the root are inherited in the children
nodes unless the children nodes override it.

So, if you add .py at the global level, all websites which did not override
the script mapping would automatically inherit settings without a problem.
The UI will also warn you of which sites are overriding the global settings
when you're setting the value (it'll pop up a little dialog asking you
permission to override the setting on a list of websites).

If you're doing this via commandline/script, it is presumed that you are
advanced enough to be aware of the issues.


 > 2. There was a SECOND problem where a script executed by IIS would be
 > passed parameters like:
 >
 > d:\Python23\python.exe D:\Documents and Settings\mark\Web\test.py

 > Dear folks at MS, this sucks. I can't control this. Unless you want to
 > make spaces in filenames illegal (fat chance), you have to help me out
 > when there are spaces in the SINGLE PARAMETER that YOU pass to me.

 > I can fix this with setting the script path in IIS to:
 > d:\Python23\python.exe "%s" %s

Be safe. Put "" around both %s.

This is nothing special here -- this is exactly as Windows has always
behaved. Namely, spaces separate commandline parameters, unless you glob
the space together with a ". You will note that in Windows, " (double
quote) is an invalid filename...


 > I feel that if IIS is passing a path, and it's got spaces, then IIS
 > ought to add the quotes on it's own. Seriously. What command could
 > possibly tell that those three things on the command line are really
 > supposed to be one? Only IIS knows this (or any caller, but here we are
 > discussing IIS).

No. This is an issue ONLY because we're talking about CGI and there is
commandline parameter passing and globbing considerations. I think that it
is completely up to the user to delineate the proper commandline parameter
globbing when configuring the server. After all, given an arbitrary
sequence of words separated by spaces, it would be impossible for any
program to discern what is the executable, what is the path, and what is the
script. It is in the user's best interest to delineate those boundaries
correctly.

Incidentally, with an ISAPI (the preferred extension method of IIS), this is
completely a non-issue -- we took care of it by giving you one variable to
retrieve the script name.


 > Please add the quotes guys. Seriously: who do I submit a bug report to?
 > This needs to be changed.
You can try to file a bug during the public beta, but I am doubtful of this
request. IIS is absolutely not going to parse the commandline and insert
stuff for you. As soon as we start doing that, it opens up an avenue of
canonicalization attacks -- the liability is not worth the gains. This
would also open up potential bugs with existing scriptmappings that already
have "%s".

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: %1 is not a valid Win32 application? 
Back to top
Login to vote
jerryiii

External


Since: Aug 26, 2003
Posts: 171



(Msg. 8) Posted: Fri Oct 10, 2003 3:07 am
Post subject: Re: %1 is not a valid Win32 application? Atgh! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Just a note on the spaces in parameters - neither Windows nor *nix based
systems will parse your example correctly, you need to use quotes to mark a
single parameter with spaces in it no matter what the OS.

Jerry

"Mark Space" <mark_space44 DeleteThis @hotmail.com> wrote in message
news:vocbdrmdn3aa3d@corp.supernews.com...
 > Argh. Well I found it but I'm not happy.
 >
 > 1. Adding a script to IIS Admin does NOT add the defintition for the
 > whole server. I had to add it to the virtual directory, and since I have
 > to add it to EVERY virtual directory (it appears) I am unhappy with IIS
5.0
 >
 > 2. There was a SECOND problem where a script executed by IIS would be
 > passed parameters like:
 >
 > d:\Python23\python.exe D:\Documents and Settings\mark\Web\test.py
 >
 > which of course the python.exe sees as THREE PARAMETERS!!!
 >
 > AAAAAAAARRRRRRRRRRRRGGGGGGGGGGGGGGGGHHHHHHHHHHHHHH!!!!!11!!!ELEVEN
 >
 > Dear folks at MS, this sucks. I can't control this. Unless you want to
 > make spaces in filenames illegal (fat chance), you have to help me out
 > when there are spaces in the SINGLE PARAMETER that YOU pass to me.
 >
 > I can fix this with setting the script path in IIS to:
 > d:\Python23\python.exe "%s" %s
 >
 > Notice the quotes around the first %s parameter. This works but is it
 > garanteed? What about the second parameter, will there be an case where
 > it fails for lack of quotes?
 >
 > I feel that if IIS is passing a path, and it's got spaces, then IIS
 > ought to add the quotes on it's own. Seriously. What command could
 > possibly tell that those three things on the command line are really
 > supposed to be one? Only IIS knows this (or any caller, but here we are
 > discussing IIS).
 >
 > Please add the quotes guys. Seriously: who do I submit a bug report to?
 > This needs to be changed.
 >
 >
 > Ok. Whew. Rant off, thanks for listening.
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: %1 is not a valid Win32 application? 
Back to top
Login to vote
kenremove

External


Since: Aug 23, 2003
Posts: 2901



(Msg. 9) Posted: Fri Oct 10, 2003 6:21 pm
Post subject: Re: %1 is not a valid Win32 application? Atgh! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Mark,

a) Settings are inherited. If you set something at the root level of a
website, it'll be inherited down. The exception is if you have a new web
application. When you create a virtual directory, it's marked as a new web
application root. You can remove this via the IIS MMC Snapin (there's a
"remove" button on the Home Directory tab), and then you vdirectory will
inherit settings from the parent folders, all the way up to the website
root.

b) WRT to spaces - you always need to use " around filepaths that contain
spaces (in the Windows world). This has been the case since Windows95
(regardless of whether you're scriping, programming or just writing batch
files). The alternative is to use the "truncated" 8.3 name (eg
c:\docume~1\mark\web\test.py) if you are supplying the actual argument.

That said, my advice is just to put things into folders that don't have
spaces in the first place - it'll save you hassles down the road.

Hope that helps.

Cheers
Ken

"Mark Space" <mark_space44.TakeThisOut@hotmail.com> wrote in message
news:vocbdrmdn3aa3d@corp.supernews.com...
: Argh. Well I found it but I'm not happy.
:
: 1. Adding a script to IIS Admin does NOT add the defintition for the
: whole server. I had to add it to the virtual directory, and since I have
: to add it to EVERY virtual directory (it appears) I am unhappy with IIS
5.0
:
: 2. There was a SECOND problem where a script executed by IIS would be
: passed parameters like:
:
: d:\Python23\python.exe D:\Documents and Settings\mark\Web\test.py
:
: which of course the python.exe sees as THREE PARAMETERS!!!
:
: AAAAAAAARRRRRRRRRRRRGGGGGGGGGGGGGGGGHHHHHHHHHHHHHH!!!!!11!!!ELEVEN
:
: Dear folks at MS, this sucks. I can't control this. Unless you want to
: make spaces in filenames illegal (fat chance), you have to help me out
: when there are spaces in the SINGLE PARAMETER that YOU pass to me.
:
: I can fix this with setting the script path in IIS to:
: d:\Python23\python.exe "%s" %s
:
: Notice the quotes around the first %s parameter. This works but is it
: garanteed? What about the second parameter, will there be an case where
: it fails for lack of quotes?
:
: I feel that if IIS is passing a path, and it's got spaces, then IIS
: ought to add the quotes on it's own. Seriously. What command could
: possibly tell that those three things on the command line are really
: supposed to be one? Only IIS knows this (or any caller, but here we are
: discussing IIS).
:
: Please add the quotes guys. Seriously: who do I submit a bug report to?
: This needs to be changed.
:
:
: Ok. Whew. Rant off, thanks for listening.
:
 >> Stay informed about: %1 is not a valid Win32 application? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Error: Not a valid password...? - Hello everyone, I'm using WinXP Pro, Dreamweaver MX, Access, ASP VBSCript. I'm having a weird problem with my Access DBs when running them locally... When I assign a password to the access database, create a system DSN using the default username and...

win32-status in IIS Log file - Where can I lookup the win32-status that can be logged in the IIS log file? I have a user who is trying to download an exe from my internal website and it is failing, but I have been unable to figure out why. Looking at the IIS log file I can see th...

sc-status sc-substatus sc-win32-status codes - Can anyone point me to a resource that explains the meaning all the different values for the sc-status, sc-substatus, and sc-win32-status codes in the IIS log file? Thanks. -Rob Brown
   Web Hosting and Web Master Forums (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]