I migrated a web server from IIS 4 to IIS 6. The Windows Scripting
Object, which I was using to copy a file, no longer seems to work. The
script is as follows. It is embedded in an ASP page, which now returns
"The page cannot be displayed" when it hits the WshShell.Run line. The
code in question is as follows:
'Create a file handling object:
Set FileSys = Server.CreateObject("Scripting.FileSystemObject")
FileName = FileSys.GetTempName
'Create a Windows Scripting Host Object -
Set WshShell = Server.CreateObject("WScript.Shell")
'Run this batch file with the WSH object -
ret=WshShell.Run("F:\phonedbapps\NewPic.bat " & strPictureID & " " &
FileName, 1, true)
The batch routine NewPic.bat is run from an IIS directory with execute
permissions:
copy D:\tempwork\tempwork.jpg D:\pictures\%1.jpg
------------------------------------------------------------
I also experimented with using the File System Object from ASP, but it
also returns "The page cannot be displayed" when it hits the line
containing ScriptObject.MoveFile. The code is as follows:
'Create a file handling object:
Const OverwriteExisting = True
Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")
ScriptObject.MoveFile "//SRV1/tempwork/tempwork.jpq",
"//SRV1/testwork/testwork.jpg"
I'm now stumped and out of ideas.
*** Sent via Developersdex http://www.developersdex.com ***