All Forums |
Register |
Login |
Search |
Subscriptions |
My Profile |
Inbox |
Tool Warehouse |
FAQs |
Resources |
Help |
Member List |
Address Book |
Logout |
|
|
WSH scripts in Interix
|
Logged in as: Guest |
Users viewing this topic: none |
|
Login  |
|
|
WSH scripts in Interix - Mar. 15, '05, 2:58:56 PM
|
|
|
breiter
Posts: 346
Joined: Jun. 14, '04,
From: Washington, DC
Status: offline
|
I am having trouble invoking Windows Scripting Host scripts from an Interix shell on a Window Server 2003 box. This works on my XP SP2 box. But on Windows Server 2003 I get a message that it can't load the ScriptingUtils, which I assume is a COM server used by WSH.
# /dev/fs/C/WINDOWS/system32/cscript.exe /nologo "C:\WINDOWS\system32\eventquery.vbs"
ERROR: Unable to create the component 'ScriptingUtils.DateTimeObject'.
However from a CMD.EXE shell it works fine.
And of course on my XP workstation it works fine.
Any ideas about what is going on here?
|
|
|
RE: WSH scripts in Interix - Mar. 15, '05, 4:21:14 PM
|
|
|
Rodney
Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
You might want to check the PATH environment variable that is being
used in the Win32 space. Maybe it can't find a particular DLL to load.
|
|
|
RE: WSH scripts in Interix - Mar. 15, '05, 4:33:05 PM
|
|
|
breiter
Posts: 346
Joined: Jun. 14, '04,
From: Washington, DC
Status: offline
|
On my XP box %PATH% is explicit:
C:\SFU\common\;C:\WINDOWS\;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\;C:\WINDOWS\system32\;C:\WINDOWS\system32\Wbem\; etc....
On the server %PATH% is set using the %SYSTEMROOT% environmental variable.
C:\Program Files\Windows Resource Kits\Tools\;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Support Tools\;C:\Program Files\Util\;C:\SFU\common\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem; etc...
Could that be the issue?
|
|
|
RE: WSH scripts in Interix - Mar. 15, '05, 9:44:39 PM
|
|
|
markfunk
Posts: 673
Joined: Mar. 31, '03,
Status: offline
|
Could be. The question is really what the PATH is in your Interix ksh.
Do you see "%systemroot% ? Or are these paths fully expanded ?
|
|
|
RE: WSH scripts in Interix - Mar. 15, '05, 10:58:39 PM
|
|
|
breiter
Posts: 346
Joined: Jun. 14, '04,
From: Washington, DC
Status: offline
|
This is _PSXLIBPATH, right?
_PSXLIBPATH=C:\Program Files\Windows Resource Kits\Tools\;C:\Program Files\Micro
soft SQL Server\80\Tools\BINN;C:\Program Files\Support Tools\;C:\Program Files\U
til\;C:\SFU\common\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;
Yes it is expanded.
Incidentally, it matter whether I try this through OpenSSH, a CSH session inside of an RDP session or right there with a screen and keyboard plugged into the server. Nothing works.
Of course, all of these mechanisms plus rxvt and xterm work on my XP SP2 with Interix workstation.
I'm mystified.
# /dev/fs/C/WINDOWS/system32/cscript.exe /nologo "C:\WINDOWS\SYSTEM32\eventquery.vbs"
ERROR: Unable to create the component 'ScriptingUtils.DateTimeObject'.
I cannot find "ScriptingUtils.DateTimeObject" documented anywhere. It actually returns 0 results from Google and search.msn.com.
|
|
|
RE: WSH scripts in Interix - Mar. 15, '05, 11:01:22 PM
|
|
|
breiter
Posts: 346
Joined: Jun. 14, '04,
From: Washington, DC
Status: offline
|
Could this be some kind of a COM+ or DCOM permission issue?
|
|
|
RE: WSH scripts in Interix - Mar. 15, '05, 11:17:33 PM
|
|
|
Rodney
Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
Best I can see is that it may be part of ASP.NET or VB.NET.
I doubt it's a permission thing. It's likely a "can't find something" thing.
On the machine in question from a CMD.EXE (where it is working) dump all the environment
variables and then compare them to a dump of all the environment variables from a ksh.
Then compare them. There could be something like a space in a pathname that is causing it.
|
|
|
RE: WSH scripts in Interix - Mar. 15, '05, 11:23:00 PM
|
|
|
Rodney
Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
Actually start a ksh and then start a CMD.EXE within this ksh.
Compare the environment variables in this CMD.EXE with a CMD.EXE's env vars
started from the Start menu.
I notice on the machine that is working that I see no spaces in PATH but I see
them on the machine that's not happy. So it might be in the double translation
that the spaces are causing a problem (delimiting where it shouldn't).
|
|
|
RE: WSH scripts in Interix - Mar. 16, '05, 7:29:00 AM
|
|
|
breiter
Posts: 346
Joined: Jun. 14, '04,
From: Washington, DC
Status: offline
|
Freestanding CMD %PATH%:
C:\Program Files\Windows Resource Kits\Tools\;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Support Tools\;C:\Program Files\Util\;C:\SFU\common\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;
CMD inside of KSH %PAT%:
C:\SFU\usr\local\bin;C:\SFU\bin;C:\SFU\opt\gcc.3.3\bin;C:\SFU\usr\contrib\bin;C:\SFU\usr\X11R6\bin;C:\SFU\usr\local\bin;C:\SFU\usr\contrib\win32\bin;C:\WINDOWS\system32;C:\SFU\common;C:\SFU\usr\games;C:\WINDOWS\system32
The CMD inside of KSH %PATH% is the same on the working and non-working scenarios. How is this %PATH% generated? It seems like it is $PATH from KSH converted to Win32-style with ;C:\WINDOWS\system32 appended.
I'm starting to think this is a red herring, though, because in neither case is it anything like the %PATH% environmental variable that is normally set.
|
|
|
RE: WSH scripts in Interix - Mar. 16, '05, 7:53:14 AM
|
|
|
breiter
Posts: 346
Joined: Jun. 14, '04,
From: Washington, DC
Status: offline
|
quote:
ORIGINAL: Rodney
I notice on the machine that is working that I see no spaces in PATH but I see
them on the machine that's not happy. So it might be in the double translation
that the spaces are causing a problem (delimiting where it shouldn't).
That's is an illusion. I cut the %PATH% in the posting down because it is so long. There are plenty of spaces in it.
C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\DotNetReflector\;C:\Program Files\gs\gs8.50\bin\;C:\Program Files\gs\gs8.14\lib\;C:\Program Files\Internet Explorer\;C:\Program Files\IIS Resources\Log Parser\;C:\Program Files\IIS Resources\SelfSSL;C:\Program Files\IIS Resources\TinyGet\;C:\Program Files\IIS Resources\WFetch\;C:\Program Files\Microsoft SQL Server\80\Tools\BINN\;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\;C:\Program
Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\;C:\Program Files\Mozilla Firefox\;C:\ProgramFiles\nmap\;C:\Program Files\Oracle\jre\1.1.8\bin\;C:\Program Files\Remote Desktop\;C:\Program Files\SnippetCompiler\;C:\Program Files\Support Tools\;C:\Program Files\Util\;C:\Program Files\Windows Resource Kits\Tools\;C:\Program Files\WinZip\;C:\SFU\common\;C:\WINDOWS\;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\;C:\WINDOWS\system32\;C:\WINDOWS\system32\Wbem\;
|
|
|
RE: WSH scripts in Interix - Mar. 16, '05, 8:41:02 PM
|
|
|
markfunk
Posts: 673
Joined: Mar. 31, '03,
Status: offline
|
It is definitely a PATH problem. I can repro your problem.
In the Interix ksh shell, look at $PATH.
All the path components need to be in Interix format.
The path that is critical is "/dev/fs/C/WINDOWS/system32/Wbem"
For me I did:
export PATH=/bin:/dev/fs/C/WINDOWS/system32/Wbem
and then your example command. works fine.
mark
|
|
|
RE: WSH scripts in Interix - Mar. 17, '05, 7:24:44 AM
|
|
|
breiter
Posts: 346
Joined: Jun. 14, '04,
From: Washington, DC
Status: offline
|
Wow. That fixed it. Thanks, Mark.
How on earth does it work on my XP box where $PATH doesn't include /dev/fs/C/WINDOWS/system32/Wbem?
|
|
|
RE: WSH scripts in Interix - Mar. 17, '05, 9:28:01 AM
|
|
|
markfunk
Posts: 673
Joined: Mar. 31, '03,
Status: offline
|
When Interix executes a win32 command, the subsystem adds a few more
paths under the covers. Essentially the system PATH that
the subsystem inherits when it boots.
So if your system PATH includes Wbem, then that's what I figure is
happening.
(side note: you noticed _PSXLIBPATH - this was the path that was supposed
to be used by the subsystem for this purpose - in theory.
But it never worked quite right and
instead of fixing the problem, we just punted to the system path
)
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
|
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts |
|
|
|