IIS/ASP/VBScript question

Author
Discussion

judas

Original Poster:

6,110 posts

270 months

Friday 26th September 2003
quotequote all
Writing a web app at the moment and testing on the localhost web server as I go. Problem is some of the script won't work on the local server, but works fine when uploaded to our main host server. Anything that uses CreateObject("Scripting.FileSystemObject") just seems hang there doing nothing. Do I need to change some obscure setting in IIS, or is it something else. The code itself is okay, just the server doesn't like it

Plotloss

67,280 posts

281 months

Friday 26th September 2003
quotequote all
Does the profile that IIS is running under have authority to interact with the desktop?

I believe you will need this, but am not 100%...

PetrolTed

34,444 posts

314 months

Friday 26th September 2003
quotequote all
I've encountered this. It's probably your local firewall preventing access to the filing system.

FunkyGibbon

3,811 posts

275 months

Friday 26th September 2003
quotequote all
In some installations of IIS the Scripting Host component is not installed. It could be this.

judas

Original Poster:

6,110 posts

270 months

Friday 26th September 2003
quotequote all
Plotloss: Logged in with full admin privileges, and write permission is granted to the web root and all subdirectories off it.
Ted: No firewall between me and the server - webserver is on same machine (localhost)!

Plotloss

67,280 posts

281 months

Friday 26th September 2003
quotequote all
Search for vbscript.dll, if it finds it then you have the scripting host so its not that.

Hmmmn....

judas

Original Poster:

6,110 posts

270 months

Friday 26th September 2003
quotequote all
FunkyGibbon said:
In some installations of IIS the Scripting Host component is not installed. It could be this.


IIS is v5.1 running on XP Pro, which I believe comes with the scripting host as standard.

Plotloss

67,280 posts

281 months

Friday 26th September 2003
quotequote all
Does it have script execution priviledge in IIS?

judas

Original Poster:

6,110 posts

270 months

Friday 26th September 2003
quotequote all
Plotloss said:
Does it have script execution priviledge in IIS?


Yup. Any other vbscript stuff works fine, just stuff to do with the FSO that fails.

judas

Original Poster:

6,110 posts

270 months

Friday 26th September 2003
quotequote all
FYI: here's some sample code that fails locally, but works ok on our host's server (% signs removed to stop it upsetting Ted's code ):

<
Set fso = CreateObject("Scripting.FileSystemObject")
Set fileObject = fso.GetFile(Server.MapPath("docs") & "" & (objRS_Documents.Fields.Item("DocFileURL").Value))
>
<
Select Case fileObject.type
Case "Text Document"
strDescription = "Text Document"
strIcon="icon_txt.gif"
Case "GIF Image"
strDescription = "GIF Image file"
strIcon="icon_gif.gif"
Case "WordPad Document"
strDescription = "Microsoft Word Document"
strIcon="icon_word_rtf.gif"
Case "PDF File"
strDescription = "Adobe Acrobat Document"
strIcon="icon_pdf.gif"
Case "XLS File"
strDescription = "Microsoft Excel Spreadsheet"
strIcon="icon_xls.gif"
Case "Powerpoint.Show.7"
strDescription = "Microsoft Powerpoint Presentation"
strIcon="icon_ppt.gif"
Case "JPEG Image"
strDescription = "JPG Image file"
strIcon="icon_jpg.gif"
Case "Rich Text Document"
strDescription = "Rich Text Document"
strIcon="icon_word_rtf.gif"
end Select
>
Edit to add: some backslashes have gone missing in the code

>> Edited by judas on Friday 26th September 11:43

dontlift

9,396 posts

269 months

Friday 26th September 2003
quotequote all
What user is IIS running under (look in servics in your control panel)

Could be that IIS itself does not hae permission to create the process.

To confirm this try setting the service to run under you administrator account, and see if it then works - although i would not recommened leaving on that account as it would be a major security risk

>> Edited by dontlift on Friday 26th September 11:49

Plotloss

67,280 posts

281 months

Friday 26th September 2003
quotequote all
Its almost certaintly permissions.

The FSO.CreatObject is trying to create an object in memory, something somewhere is stopping this happening...

judas

Original Poster:

6,110 posts

270 months

Friday 26th September 2003
quotequote all
dontlift said:
What user is IIS running under (look in servics in your control panel)

Could be that IIS itself does not hae permission to create the process.


It's using the local system account. Tried setting the 'Allow desktop interaction' box but that's killed IIS now. Have to screw around a bit more and restart. BRB

dontlift

9,396 posts

269 months

Friday 26th September 2003
quotequote all
judas said:

dontlift said:
What user is IIS running under (look in servics in your control panel)

Could be that IIS itself does not hae permission to create the process.



It's using the local system account. Tried setting the 'Allow desktop interaction' box but that's killed IIS now. Have to screw around a bit more and restart. BRB


Set the service to run under Administrator and retry it..... if that works then permissions is confirmed, you can then create a new account and give it just enough permissions to do what it needs to do and no more

PetrolTed

34,444 posts

314 months

Friday 26th September 2003
quotequote all
judas said:
Ted: No firewall between me and the server - webserver is on same machine (localhost)!


This is precisely my point. If you have a firewall on your development box such as Norton thingy, then it can prevent writing via script as a security measure. When I turned off this protection my scripts worked fine.

judas

Original Poster:

6,110 posts

270 months

Friday 26th September 2003
quotequote all
No firewall on this box. Only thing is Norton AV. I've disabled script blocking, but IIS is screwed at the moment so I dunno if that's worked

judas

Original Poster:

6,110 posts

270 months

Friday 26th September 2003
quotequote all
Ted - you're a star! It was indeed Norton managing, as usual, to mess things up. Thank you!

Thank you to everyone else for you suggestions

Happy now!