Home All Groups Group Topic Archive Search About

Running Bat file from ASP on Windows Server x64 problem.

Author
10 Oct 2006 2:20 AM
GP
Hi,

I'm having trouble running a bat file from an ASP page.
It works fine on Windows 2003 Std x32 server but fails now we have upgraded
to the x64 edition

In the ASP we are trying to run the following

    Set oWSH= Server.CreateObject("WScript.Shell")

     errmsg = oWSH.Run("d:\\scripts\\copyiissettings.bat 10.0.0.156",0,True)

    set oWSH = nothing

The errmsg is returning 1 (not very helpful)

In the BAT file we are running the following command:
cscript.exe c:\windows\system32\iiscnfg.vbs /copy /ts %1 /tu machineusername
/tp machinepassword

I am sure the permissions are setup correctly in IIS as both the Application
Pool and Authenticated Anonymous User are set as the Administrator. We are
also running IIS with he following flag enabled Enable32BitAppOnWin64=True
I can only think maybe there is a problem being related to the fact we are
running x64 and perhaps there is a registry setting or group policy setting
i need to change?

Thanks,
Greg.

Author
10 Oct 2006 12:49 PM
Slim
try running a simple bat file like

c:
cd\

see if that errors.




Show quoteHide quote
"GP" <supp***@powerfront.com> wrote in message
news:uL4x4KB7GHA.4352@TK2MSFTNGP05.phx.gbl...
> Hi,
>
> I'm having trouble running a bat file from an ASP page.
> It works fine on Windows 2003 Std x32 server but fails now we have
> upgraded to the x64 edition
>
> In the ASP we are trying to run the following
>
>    Set oWSH= Server.CreateObject("WScript.Shell")
>
>     errmsg = oWSH.Run("d:\\scripts\\copyiissettings.bat
> 10.0.0.156",0,True)
>
>    set oWSH = nothing
>
> The errmsg is returning 1 (not very helpful)
>
> In the BAT file we are running the following command:
> cscript.exe c:\windows\system32\iiscnfg.vbs /copy /ts %1 /tu
> machineusername /tp machinepassword
>
> I am sure the permissions are setup correctly in IIS as both the
> Application Pool and Authenticated Anonymous User are set as the
> Administrator. We are also running IIS with he following flag enabled
> Enable32BitAppOnWin64=True
> I can only think maybe there is a problem being related to the fact we are
> running x64 and perhaps there is a registry setting or group policy
> setting i need to change?
>
> Thanks,
> Greg.
>
>
>
>
>
>
Are all your drivers up to date? click for free checkup

Author
11 Oct 2006 1:36 AM
GP
i figured it out.

problem is that when you call the bat from the ASP it runs as a 32 bit
process and runs the cscript.exe from the syswow64 directory and this fails.
i copied the cscript.exe from the system32 into the syswow64 directory and
this fixed the problem

g.

Show quoteHide quote
"Slim" <m*@here.com> wrote in message
news:uYKhrsG7GHA.4604@TK2MSFTNGP03.phx.gbl...
> try running a simple bat file like
>
> c:
> cd\
>
> see if that errors.
>
>
>
>
> "GP" <supp***@powerfront.com> wrote in message
> news:uL4x4KB7GHA.4352@TK2MSFTNGP05.phx.gbl...
>> Hi,
>>
>> I'm having trouble running a bat file from an ASP page.
>> It works fine on Windows 2003 Std x32 server but fails now we have
>> upgraded to the x64 edition
>>
>> In the ASP we are trying to run the following
>>
>>    Set oWSH= Server.CreateObject("WScript.Shell")
>>
>>     errmsg = oWSH.Run("d:\\scripts\\copyiissettings.bat
>> 10.0.0.156",0,True)
>>
>>    set oWSH = nothing
>>
>> The errmsg is returning 1 (not very helpful)
>>
>> In the BAT file we are running the following command:
>> cscript.exe c:\windows\system32\iiscnfg.vbs /copy /ts %1 /tu
>> machineusername /tp machinepassword
>>
>> I am sure the permissions are setup correctly in IIS as both the
>> Application Pool and Authenticated Anonymous User are set as the
>> Administrator. We are also running IIS with he following flag enabled
>> Enable32BitAppOnWin64=True
>> I can only think maybe there is a problem being related to the fact we
>> are running x64 and perhaps there is a registry setting or group policy
>> setting i need to change?
>>
>> Thanks,
>> Greg.
>>
>>
>>
>>
>>
>>
>
>
Author
12 Oct 2006 12:50 PM
Slim
I would of thought that bat files run without cscript

Show quoteHide quote
"GP" <supp***@powerfront.com> wrote in message
news:%230r9CXN7GHA.1560@TK2MSFTNGP04.phx.gbl...
>i figured it out.
>
> problem is that when you call the bat from the ASP it runs as a 32 bit
> process and runs the cscript.exe from the syswow64 directory and this
> fails.
> i copied the cscript.exe from the system32 into the syswow64 directory and
> this fixed the problem
>
> g.
>
> "Slim" <m*@here.com> wrote in message
> news:uYKhrsG7GHA.4604@TK2MSFTNGP03.phx.gbl...
>> try running a simple bat file like
>>
>> c:
>> cd\
>>
>> see if that errors.
>>
>>
>>
>>
>> "GP" <supp***@powerfront.com> wrote in message
>> news:uL4x4KB7GHA.4352@TK2MSFTNGP05.phx.gbl...
>>> Hi,
>>>
>>> I'm having trouble running a bat file from an ASP page.
>>> It works fine on Windows 2003 Std x32 server but fails now we have
>>> upgraded to the x64 edition
>>>
>>> In the ASP we are trying to run the following
>>>
>>>    Set oWSH= Server.CreateObject("WScript.Shell")
>>>
>>>     errmsg = oWSH.Run("d:\\scripts\\copyiissettings.bat
>>> 10.0.0.156",0,True)
>>>
>>>    set oWSH = nothing
>>>
>>> The errmsg is returning 1 (not very helpful)
>>>
>>> In the BAT file we are running the following command:
>>> cscript.exe c:\windows\system32\iiscnfg.vbs /copy /ts %1 /tu
>>> machineusername /tp machinepassword
>>>
>>> I am sure the permissions are setup correctly in IIS as both the
>>> Application Pool and Authenticated Anonymous User are set as the
>>> Administrator. We are also running IIS with he following flag enabled
>>> Enable32BitAppOnWin64=True
>>> I can only think maybe there is a problem being related to the fact we
>>> are running x64 and perhaps there is a registry setting or group policy
>>> setting i need to change?
>>>
>>> Thanks,
>>> Greg.
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>

Bookmark and Share