Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help: Command Prompt code misbehaving in VBS

3 views
Skip to first unread message

catsAreMyFriends

unread,
Feb 26, 2008, 2:24:01 PM2/26/08
to
Can anyone tell me why the following does not work?

I am trying to move the following Command Prompt code into a VB Script:

"c:\Program Files\Microsoft ActiveSync\CEAPPMGR.EXE" " helloworldproject.ini"

I have tested this and it successfully fires up the CEAppManager.exe on the
file helloworldproject.ini.

I moved this into the following VBScript...


Set strshell= CreateObject("WScript.Shell")
strshell.run """c:\Program Files\Microsoft ActiveSync\CEAPPMGR.EXE""
""helloworldproject.ini"""

When I run this script, I get an error from CEAppManager as follows...
Error in Windows CE Setup Files: Application Manager cannot install this
application on your mobile device due to an error in the setup file.

It kind of looks to me like the script is not feeding parameter that I am
passing to CEAppManager (i.e. the hellowworldproject.ini) in the the way that
CEAppManager expects.

Please note that
1)when I execute the code in the CommandPrompt I have previously navigated
to the folder containing the INI file.
2) when I execute the VBS script I am also in the folder containing the
INI file.

Thanks in advance!

Pegasus (MVP)

unread,
Feb 26, 2008, 3:06:35 PM2/26/08
to
Assuming that a tried and proven application is "misbehaving"
usually leads you down the wrong track, increasing the pain
of trouble-shooting. In this case your code simply lacks a few
double-quotes to satisfy the Command Processor. Try this:

DQ=""""
strshell.run DQ & "c:\Program Files\Microsoft ActiveSync\CEAPPMGR.EXE" _
& DQ & " " & DQ & "d:\Some Folder\helloworldproject.ini" & DQ


"catsAreMyFriends" <catsAreM...@discussions.microsoft.com> wrote in
message news:D2C5643D-1BCA-4503...@microsoft.com...

Mike@RealtyPro

unread,
Feb 26, 2008, 3:39:53 PM2/26/08
to


Many thanks Pegasus!! That fixed it!

ekkehard.horner

unread,
Feb 26, 2008, 4:18:37 PM2/26/08
to
Pegasus (MVP) schrieb:

> Assuming that a tried and proven application is "misbehaving"
> usually leads you down the wrong track, increasing the pain
> of trouble-shooting. In this case your code simply lacks a few
> double-quotes to satisfy the Command Processor. Try this:
>
> DQ=""""
> strshell.run DQ & "c:\Program Files\Microsoft ActiveSync\CEAPPMGR.EXE" _
> & DQ & " " & DQ & "d:\Some Folder\helloworldproject.ini" & DQ
>
> "catsAreMyFriends" <catsAreM...@discussions.microsoft.com> wrote in
> message news:D2C5643D-1BCA-4503...@microsoft.com...
>> Can anyone tell me why the following does not work?
>>
>> I am trying to move the following Command Prompt code into a VB Script:
>>
>> "c:\Program Files\Microsoft ActiveSync\CEAPPMGR.EXE" "
>> helloworldproject.ini"
>>
>> I have tested this and it successfully fires up the CEAppManager.exe on
>> the
>> file helloworldproject.ini.
>>
>> I moved this into the following VBScript...
>>
>> Set strshell= CreateObject("WScript.Shell")
>> strshell.run """c:\Program Files\Microsoft ActiveSync\CEAPPMGR.EXE""
>> ""helloworldproject.ini"""
[...]

The therapy is proven to be correct, but I doubt the diagnosis. Regarding
the quotes there is no difference between the commands. So I assume using
the full path to the .ini file did the trick.

(I wouldn't nit pick a working solution but for two reasons: I my opinion
using the VBScript escape "" for " in literals is a valid method that
shouldn't be suspected unwarrentedly; path/current folder problems when
using .Run or .Exec are nasty and deserve attention/research.)

0 new messages