Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I was executing this command without any problem:

cscript.exe C:\search.vbs D:/myfolder/

When suddenly, after closing and opening the console again, this error appears in a popup when trying to execute the same previous command.

C:Users/Administrator/cscript.exe is not a valid win32 application

I've seen this related topic and, although that's about windows 2003, the proposed solution works.

But my windows 2008 server is a 64 bits machine and before I had this problem the command was perfectly working.

What happened? why is not working anymore? Would it be exactly the same to solve the problem with the full path pointing at system32 although my system runs over 64 bits?

share|improve this question
2  
Were you running the console before as an Adminstrator and now you aren't when you get the error? You should point to the full path of cscript regardless...makes for better syntax. Or you can start switching to Powershell. –  TheCleaner Feb 3 at 15:00

1 Answer 1

up vote 2 down vote accepted

Yeap, this is a PITA and I ran into this when moving to 64 bit too. For me, I changed out the source path for cscript to:

%windir%\syswow64\cmd.exe /C "cscript.exe <scriptname>.vbs"

Basically cscript won't run unless you launch a 32bit version of the command line interpreter. Don't ask me why Redmond puts the 32bit one in the syswow64 folder.

in your case the command line would be

%windir%\syswow64\cmd.exe /C "cscript.exe C:\search.vbs D:/myfolder/"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.