IIS/ASP/VBScript question
Discussion
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 

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

<
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
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
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
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

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
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.
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff