Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / June 2004



Tip: Looking for answers? Try searching our database.

shell in VB6

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vleugels - 27 Jun 2004 12:27 GMT
Hi everyone,

I am an absolute newbie in VB, so I have a lot of questions in the future.
Now I have a little problem. I tried to open an application like this:

Private Sub Command1_Click()
Shell "C:\Program Files\acd systems\acdsee\5.0\acdsee5.exe", vbNormalFocus
End Sub

but this does not work.
All other applications I start in the same way work fine.
Like this one:

Private Sub Command14_Click()
Shell "C:\Program Files\Adobe\acrobat 6.0\acrobat\acrobat.exe",
vbNormalFocus
End Sub

What is wrong with ACDSee (or with me?)

Thanks for your response.
J French - 27 Jun 2004 15:37 GMT
>Hi everyone,
>
[quoted text clipped - 7 lines]
>but this does not work.
>All other applications I start in the same way work fine.

Does the file exist?
Randy Birch - 27 Jun 2004 15:50 GMT
Got to the shortcut you'd usually use to starting the problem app examine
the shortcut properties.  Note any command-line parameters that might also
be passed.  Often the absence of a particular command causes the app to
either fail to start or start in an undesired/unexpected) mode.

Signature

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.

: Hi everyone,
:
[quoted text clipped - 17 lines]
:
: Thanks for your response.
Vleugels - 28 Jun 2004 05:47 GMT
Thanks for you response Randy.

I examined the shortcut, but the problem is that this shortcut does not
contain the complete path to the application. Don't ask me why! So I typed
the path in the shell-command myself.. I did this for more apps and they
work all fine. VB finds the app but does not start it. Double-clicking on
the app in Explorer works good.
Is there another way in VB to start an app?

Thanks again.

> Got to the shortcut you'd usually use to starting the problem app examine
> the shortcut properties.  Note any command-line parameters that might also
[quoted text clipped - 16 lines]
> : Shell "C:\Program Files\acd systems\acdsee\5.0\acdsee5.exe", vbNormalFocus
> : End Sub
J French - 28 Jun 2004 07:37 GMT
>Thanks for you response Randy.
>
[quoted text clipped - 4 lines]
>the app in Explorer works good.
>Is there another way in VB to start an app?

How do you know that VB finds the EXE ?
Vleugels - 28 Jun 2004 16:39 GMT
Because, after changing the name of the file the system responds: File not
found.
Not to difficult to understand. Even not for a newbie like I am.
So if you have a solution for my problem I would like to hear.
Thank you.

> How do you know that VB finds the EXE ?
J French - 28 Jun 2004 17:24 GMT
>Because, after changing the name of the file the system responds: File not
>found.
>Not to difficult to understand. Even not for a newbie like I am.
>So if you have a solution for my problem I would like to hear.
>Thank you.

Enclose the file name in quotes

eg:  Chr$(34) + FileName + Chr$(34)

Also do a GetAttr( FixedFileName )

That is the (pretty much) definitive way of checking a file exists.
Vleugels - 28 Jun 2004 20:04 GMT
I'm sorry, but I think you are blind: read my messages before you give an
answer.

> >Because, after changing the name of the file the system responds: File not
> >found.
[quoted text clipped - 9 lines]
>
> That is the (pretty much) definitive way of checking a file exists.
J French - 29 Jun 2004 08:28 GMT
>I'm sorry, but I think you are blind: read my messages before you give an
>answer.

I shall refrain from replying ascerbically

It might interest you to read your own posts

>Shell "C:\Program Files\acd systems\acdsee\5.0\acdsee5.exe", vbNormalFocus

Now look carefully at that full path and file name

It has lots of spaces in it (well two actually)

I have a Directory called:   'c:\Test Dir' with nothing in it
Also I have a program called:  'c:\Test.exe

Shell "c:\test dir\project2.exe", vbNormalFocus

Guess what ?  
This runs 'c:\test.exe'
- with 'dir\project2.exe' as the Command line parameter

There is a possibility that you are actually running some other App
- one needs to eliminate that possibility

If you wrap the whole thing in Chr$(34) then you stand a chance of the
thing working - or throwing an interesting error.

This may, or may not be the problem
- but it is a rudimentary diagnosic step.

Your first post displayed the typical 'novice' approach that if
something does not work, it is down to VB - not you.

This is seldom the case - in 99.99% of cases it is down to idiocy or
misunderstanding on the part of the programmer

I assumed you understand enough about Long File Names to pick up on
the use of Chr$(34)  eg:  "   "    -  AKA  Quotes
Petrik Salovaara - 29 Jun 2004 14:38 GMT
> This may, or may not be the problem

It is not. In fact, from VB's point of view, there
is no problem. Shell command functions just fine, it
launches the acdsee5.exe, who exits immediately without
displaying any dialogs.

All of this would have been clear to the OP if he only
had tried to start the app from DOS box or command prompt.
Doing so yields to an error message about missing
ACDAppInfo.DLL.

So it is clear that one has to provide some kind of command
line argument to launch ACDSee viewer/browser. What that
argument might be, I could no figure out in those few minutes
I spent researching this case.
Satan's Evil Twin - 29 Jun 2004 14:52 GMT
All one would need to do is inspect the properties of the shortcut link
created in the program's start menu folder to see how to start the program
normally using the shell function. Also, as someone else had suggested, look
in the registry to see how a file associated with ACDSee is launched (i.e.
when double-clicked).

> > This may, or may not be the problem
>
[quoted text clipped - 12 lines]
> argument might be, I could no figure out in those few minutes
> I spent researching this case.
Petrik Salovaara - 29 Jun 2004 15:18 GMT
> All one would need to do is inspect the properties of the shortcut
> link created in the program's start menu folder to see how to start
> the program normally using the shell function.

In this case, no luck there because ACDSee app is of
special type - shortcut's "Target" textbox is disabled and
has only text "ACDSee 5.0 Power Pack".
Satan's Evil Twin - 29 Jun 2004 16:08 GMT
I don't doubt what you say - I do not have ACDSee installed on my computer -
but I have not seen a shortcut that has the target textbox disabled. Even if
it is disabled, you should still be able to see the text, just not edit it.
Is that not the case?

In any event, I think the OP's real problem is that he is not changing to
the app's "working directory" before shelling the command and/or he has made
an idiot mistake on the command line he is shelling.

J. French is right, too much time and effort has been spent for someone who
does not deserve it.

> > All one would need to do is inspect the properties of the shortcut
> > link created in the program's start menu folder to see how to start
[quoted text clipped - 3 lines]
> special type - shortcut's "Target" textbox is disabled and
> has only text "ACDSee 5.0 Power Pack".
Mike Williams - 29 Jun 2004 18:34 GMT
> . . . . . I have not seen a shortcut that has the target textbox
> disabled. Even if it is disabled, you should still be able to see
> the text, just not edit it. Is that not the case?

A lot of applications create shortcuts of the kind described, where they do
not display the real path, or perhaps no path at all, in the target box.
Microsoft Office installations usually do it when they create Desktop and
Start Menu shortcuts, and I would imagine that newer versions of ACDSee
might do the same, considering all the trouble they had with piracy in
earlier versions. On my machine if I look at the desktop shortcut for
Microsoft Word the target is greyed out and just says "Microsoft Office
2000". However, if I write a little VB program to open the shortcut (.lnk
file) as binary and get it into a Byte Array I can see that it contains the
Unicode string . . .

"Program Files\Microsoft Office\Office\Winword.exe"

. . . which is the real location of the executable. Perhaps if the OP opens
up the shortcut (.lnk) file of ACDSee he may see similar information
(perhaps including the required Command Line argument, if there is one).

> In any event, I think the OP's real problem is that he is not
> changing to the app's "working directory" before shelling

Actually, I think the OP's real problem is his attitude!

Mike
Satan's Evil Twin - 29 Jun 2004 18:58 GMT
Thanks for that, Mike. Checking my MS Office shortcuts reveals what Petrik
had indicated. I hadn't had a need to look at these before specifically
because I would typically get this path from the file association in the
registry.

> > . . . . . I have not seen a shortcut that has the target textbox
> > disabled. Even if it is disabled, you should still be able to see
[quoted text clipped - 23 lines]
>
> Mike
Mike Williams - 29 Jun 2004 20:11 GMT
> Thanks for that, Mike. Checking my MS Office shortcuts reveals
> what Petrik had indicated. I hadn't had a need to look at these before
> specifically because I would typically get this path from the file
> association in the registry.

You're welcome. By the way, I know that you can get full paths for various
applications from the Registry (if you know what file extensions are
associated with them), but some applications (and ACDSee is one of them)
don't necessarily have any file extension associations at all. It is
basically a viewer that displays graphic files of various types in a nice
way, but it doesn't necessarily open up with any particular graphic file
type.

Mike
Randy Birch - 30 Jun 2004 03:34 GMT
MS office apps and such have 'special' shortcut property dialogs that do not
display the command line for the app.  You have to dig through the registry
to find the command lines.

Signature

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.

: I don't doubt what you say - I do not have ACDSee installed on my computer -
: but I have not seen a shortcut that has the target textbox disabled. Even if
[quoted text clipped - 15 lines]
: > special type - shortcut's "Target" textbox is disabled and
: > has only text "ACDSee 5.0 Power Pack".
Randy Birch - 30 Jun 2004 03:35 GMT
oops ... just did a refresh and found this was answered much earlier.

Signature

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.

: MS office apps and such have 'special' shortcut property dialogs that do not
: display the command line for the app.  You have to dig through the registry
[quoted text clipped - 24 lines]
: : > special type - shortcut's "Target" textbox is disabled and
: : > has only text "ACDSee 5.0 Power Pack".
J French - 29 Jun 2004 15:19 GMT
>> This may, or may not be the problem
>
[quoted text clipped - 12 lines]
>argument might be, I could no figure out in those few minutes
>I spent researching this case.

You are over generous in researching this misanthropope's problem.

Petrik Salovaara - 30 Jun 2004 09:22 GMT
erewhon@nowhere.com (J French) wrote in news:40e1771c.114657745
@news.btclick.com:

> You are over generous in researching this misanthropope's problem.
 
Well yes, but it turned out to be an interesting case in the end.
Didn't know that shortcuts could be camouflaged this way. Now
all that's left is to figure out how to do it yourself. Any ideas?

(Not that I'm going to use this technique myself. It seems like a
very bad idea, makes life a lot more compilcated for end users.)
Mike Williams - 30 Jun 2004 09:47 GMT
> Well yes, but it turned out to be an interesting case in the
> end. Didn't know that shortcuts could be camouflaged this
> way. Now all that's left is to figure out how to do it yourself.
> Any ideas?

The following might provide a few clues:

http://www.i2s-lab.com/Papers/The_Windows_Shortcut_File_Format.pdf

Mike
Mike Williams - 28 Jun 2004 08:14 GMT
> I examined the shortcut, but the problem is that this shortcut
> does not contain the complete path to the application.

Are you absolutely sure that you have the correct path / file name, and that
you are not inadvertently trying to run the setup program or something else
that is not actually the ACDSee exe? I know the following code is a bit of
overkill for this little job (it is a modification of some code that I wrote
to clear file attributes) but it will fill a Textbox with the full path /
name of all files that contain the phrase "acdsee" and end with ".exe". When
you have decided which of the files is the one you are looking for then
you'll be able to use CtrlC / CtrlV to copy / paste it into your code (don't
forget to have your other VB IDE running before you use CtrlV because the VB
IDE trashes the Windows cliupboard when it starts up). Also, is there any
chance that ACDSee has set itself up so as to be available only to persons
logged on as Administrator, and that it might deliberately refuse to start
othjerwise? Just an idea. Here's the code to diaply the file names. Paste it
into a VB Form containing one Text Box and one Command Button (Set the Text
Box Multiline to True in the IDE). When you run the code, click the button
and select your main drive (so that it will search the entire drive):

Mike

Option Explicit
Const MAX_PATH = 260
Private Type FILETIME
  dwLowDateTime As Long
  dwHighDateTime As Long
End Type
Private Type WIN32_FIND_DATA
   lngFileAttributes As Long           ' File attributes
   ftCreationTime As FILETIME          ' Creation time
   ftLastAccessTime As FILETIME        ' Last access time
   ftLastWriteTime As FILETIME         ' Last modified time
   lngFileSizeHigh As Long             ' Size (hi word)
   lngFileSizeLow As Long              ' Size (lo word)
   lngReserved0 As Long                ' reserved
   lngReserved1 As Long                ' reserved
   strFileName As String * MAX_PATH    ' File name
   strAlternate As String * 14         ' 8.3 file name
End Type
Private Type BrowseInfo
 hWndOwner As Long
 pidlRoot As Long
 sDisplayName As String
 sTitle As String
 ulFlags As Long
 lpfn As Long
 lParam As Long
 iImage As Long
End Type
Private Declare Function SHBrowseForFolder Lib "shell32.dll" _
(bBrowse As BrowseInfo) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" _
(ByVal lItem As Long, ByVal sDir As String) As Long
Private Declare Function FindFirstFile Lib "kernel32" _
Alias "FindFirstFileA" (ByVal lpFileName As String, _
lpFindFileData As WIN32_FIND_DATA) As Long
Private Declare Function FindNextFile Lib "kernel32" _
Alias "FindNextFileA" (ByVal hFindFile As Long, _
lpFindFileData As WIN32_FIND_DATA) As Long
Private Declare Function FindClose Lib "kernel32" _
(ByVal hFindFile As Long) As Long
Private Const FILE_ATTRIBUTE_ARCHIVE = &H20
Private Const FILE_ATTRIBUTE_COMPRESSED = &H800
Private Const FILE_ATTRIBUTE_DIRECTORY = &H10
Private Const FILE_ATTRIBUTE_HIDDEN = &H2
Private Const FILE_ATTRIBUTE_NORMAL = &H80
Private Const FILE_ATTRIBUTE_READONLY = &H1
Private Const FILE_ATTRIBUTE_SYSTEM = &H4
Private Const FILE_ATTRIBUTE_TEMPORARY = &H100

Private Function Browse_Folder() As String
' Let the user browse for a folder. Return the
' selected folder. Return an empty string if
' the user cancels.
Dim browse_info As BrowseInfo
Dim lItem As Long
Dim sDirName As String
Dim hwnd As Long
browse_info.hWndOwner = hwnd
browse_info.pidlRoot = 0
browse_info.sDisplayName = Space$(260)
browse_info.sTitle = "Select Folder"
browse_info.ulFlags = 1 ' Return folder name.
browse_info.lpfn = 0
browse_info.lParam = 0
browse_info.iImage = 0
lItem = SHBrowseForFolder(browse_info)
If lItem Then
 sDirName = Space$(260)
 If SHGetPathFromIDList(lItem, sDirName) Then
   Browse_Folder = Left(sDirName, _
     InStr(sDirName, Chr$(0)) - 1)
 Else
   Browse_Folder = ""
 End If
End If
End Function

Private Sub ClearAttributes(strFolderPath As String)
Dim fd As WIN32_FIND_DATA
Dim hFind As Long
Dim strFile As String
Dim strSearch As String
If Right$(strFolderPath, 1) <> "\" Then strFolderPath _
 = strFolderPath & "\"
strSearch = strFolderPath & "*.*"
hFind = FindFirstFile(strSearch, fd)
If hFind > 0 Then
 Do
   strFile = Left$(fd.strFileName, _
     InStr(fd.strFileName, Chr(0)) - 1)
   If (fd.lngFileAttributes And FILE_ATTRIBUTE_DIRECTORY) _
     = FILE_ATTRIBUTE_DIRECTORY Then
     If strFile = "." Or strFile = ".." Then
       '
     Else
       ' It is a directory so do what you want to do with
       ' directories. In this example we want to:
       ' (1) Set its attributes to Normal
       'SetAttr strFolderPath & strFile, vbNormal
       ' (2) Recursively trawl that directory (if you comment
       ' out the following line then this Function will deal
       ' only with files in the target directory and will not
       ' "drill down" recursively
       ClearAttributes strFolderPath & strFile
     End If
   Else
     ' It is a file (not a directory) so do what you want to
     ' do with files. In this example we want to:
     ' (1) Set its attributes to Normal
     'SetAttr strFolderPath & strFile, vbNormal
     '
     '
     If InStr(LCase(strFile), "acdsee") > 0 And _
         Right$(LCase(strFile), 4) = ".exe" Then
       Text1.Text = Text1.Text & _
         (strFolderPath & strFile) & vbCrLf
     End If
     '
     '
   End If
 Loop While CBool(FindNextFile(hFind, fd))
 Call FindClose(hFind)
End If
End Sub

Private Sub Command1_Click()
' Set Text1 Multinline to True in the IDE
Me.WindowState = vbMaximized
DoEvents
Text1.Move 0, 0, Me.Width, Me.Height / 3
Text1.Text = ""
Dim sfolder As String
sfolder = Browse_Folder
If sfolder = "" Then ' Cancel
 Caption = "No Folder Selected"
Else
 Caption = "Please wait . . . . ."
 ClearAttributes sfolder
 Caption = "Done."
 Text1.Text = Text1.Text & "Done."
End If
End Sub
Mike Williams - 28 Jun 2004 08:33 GMT
> . . . name of all files that contain the phrase "acdsee" . . .

Oops! Did I say "phrase"? Yep. Sure did. Someone's bound to pick me up on
that little error! I of course meant to say "string" ;-)

Mike
Vleugels - 28 Jun 2004 16:46 GMT
Thank you Mike for your little app. I tried it, knowing that it would be a
waste of time because I checked everything several times.
Indeed: I got exactly the same as I typed before.

>Also, is there any
>chance that ACDSee has set itself up so as to be available only to persons
>logged on as Administrator, and that it might deliberately refuse to start
>othjerwise?

Hmm, good thinking. But it is a stand-alone system and guess who is the
Admin? Right!

So I think we cannot solve this problem in this way.
Thank you anyway for your help.
If you know something else: I like to hear that. If not: no bad feelings.

Barry.

> > I examined the shortcut, but the problem is that this shortcut
> > does not contain the complete path to the application.
>
> Are you absolutely sure that you have the correct path / file name, and that
> you are not inadvertently trying to run the setup program or something else
Mike Williams - 28 Jun 2004 19:00 GMT
> Hmm, good thinking. But it is a stand-alone system and guess
> who is the Admin? Right!

When you say "it doesn't work", what exactly do you mean. Presumably you are
not getting any error message, otherwise you would have told us. So do you
mean that when you click the button nothing happens at all?

If you are *absolutely sure* that you have the correct path and file name
(which I think you must have or you would get a file not found error) and if
you are also absolutely sure that the file is actually the ACDSee executable
and not some sort of setup file then I'm at a bit of a loss to figure out
what is going wrong . . .

. . . unless, of course, the Shell code that you are using is not actually
in the button you are clicking! (Daft as it sounds, it's happened to me
before!). Wherever it is you have the code:

Shell "C:\Program Files\acd systems\acdsee\5.0\acdsee5.exe", vbNormalFocus

chage it to:

Me.Caption = "Got this far . . ."
Shell "C:\Program Files\acd systems\acdsee\5.0\acdsee5.exe", vbNormalFocus

Does your Form Caption change when you click the button?

I have ACDSee version 3.0 on my system and it works exactly as expected,
whether I run it using standard Windows methods or whether I Shell it in a
VB app.

Mike
Vleugels - 28 Jun 2004 20:13 GMT
> When you say "it doesn't work", what exactly do you mean. Presumably you are
> not getting any error message, otherwise you would have told us. So do you
> mean that when you click the button nothing happens at all?

Right!!

> If you are *absolutely sure* that you have the correct path and file name
> (which I think you must have or you would get a file not found error) and if
> you are also absolutely sure that the file is actually the ACDSee executable
> and not some sort of setup file then I'm at a bit of a loss to figure out
> what is going wrong . . .

> Me.Caption = "Got this far . . ."
> Shell "C:\Program Files\acd systems\acdsee\5.0\acdsee5.exe", vbNormalFocus

I did this. Form caption changed indeed.
Then I did:

Me.Caption = "Got this far . . ."
Shell "C:\Program Files\acd systems\acdsee\5.0\acdsee5.exe", vbNormalFocus
Me.Caption = "Got so far...."

Form.Caption changed again.

Hmm. Any good idea's?
I don't.

Barry.
Mike Williams - 28 Jun 2004 20:16 GMT
>  Hmm. Any good idea's?

Yes. I've got a few more ideas. But I don't think I'll bother. I don't like
your attitude (not in response to my messages, but in response to those of
others). Drop the attitude and you might stand a better chance of getting
more replies.

Mike
luminos - 28 Jun 2004 23:11 GMT
He has terrible attitude and is unworthy of help.  I could not believe what
I read previously:   "are you blind"?  Maybe yes, literally.  He is a jerk.

> >  Hmm. Any good idea's?
>
[quoted text clipped - 4 lines]
>
> Mike
Randy Birch - 28 Jun 2004 23:54 GMT
*Somewhere* in the registry is the full path to this exe.  You'll have to
find it and compare it to your Shell string. As I don't have this utility
installed I can't be more help.  But the authors do have a developer program
and SDK that may also be of help ... see
http://www.acdsystems.com/english/partners/sdkpartners/index

Signature

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.

: Thanks for you response Randy.
:
[quoted text clipped - 29 lines]
: vbNormalFocus
: > : End Sub
Petrik Salovaara - 28 Jun 2004 22:25 GMT
> Shell "C:\Program Files\acd systems\acdsee\5.0\acdsee5.exe",

Try to start ACDSee from Command Prompt with the above path.
What happens?
Vleugels - 29 Jun 2004 17:46 GMT
Last comment in this case:

Thank to everybody for his contribution in this discussion. I found enough
tips in here to solve the problem. Everything is working fine now.
And: J. French: I didn't want to be rude in anyway. I'm really sorry if you
are hurt in one way.

Thanks again.

Barry.
J French - 30 Jun 2004 07:34 GMT
>Last comment in this case:
>
>Thank to everybody for his contribution in this discussion. I found enough
>tips in here to solve the problem. Everything is working fine now.
>And: J. French: I didn't want to be rude in anyway. I'm really sorry if you
>are hurt in one way.

Best tell us what the problem was
- these NGs double as an historical archive
Mike Williams - 30 Jun 2004 09:28 GMT
> Best tell us what the problem was
> - these NGs double as an historical archive

Agreed. Lots of people seem to go away as soon as they have their answer
without even bothering to post back to tell us which suggestion (if any)
solved their problem. Rob so far seems to have done the same with his
"Printing in VB6" problem. Come on Vleugels (and Rob). Tell us what your
problem actually was and how you fixed it.

Mike
J French - 30 Jun 2004 12:39 GMT
>> Best tell us what the problem was
>> - these NGs double as an historical archive
[quoted text clipped - 4 lines]
>"Printing in VB6" problem. Come on Vleugels (and Rob). Tell us what your
>problem actually was and how you fixed it.

It is scary how these NGs are 'set in amber'
- one inebriated slip ... and it is there for posterity

... mind you, what has posterity ever done for me ? (c) ???
Vleugels - 30 Jun 2004 16:46 GMT
> >"Printing in VB6" problem. Come on Vleugels (and Rob). Tell us what your
> >problem actually was and how you fixed it.

I'm sorry for this late reaction, but yesterday I didn't have time to
explain more about the solution.
Now there is time.
Okay, here we go:

I tried to run the app by "C:\Program Files\acd
systems\acdsee\5.0\acdsee5.exe" on the command-line in the startmenu.
That worked well.
So the line Shell "C:\Program Files\acd systems\acdsee\5.0\acdsee5.exe",
vbNormalFocus must be okay.
But the same line does not work in VB.

Double-clicking the filename acdsee5.exe in the dir C:\Program Files\acd
systems\acdsee\5.0\ had the same result. App works from here.

After adding a few lines in the VB-script, changing form.caption (thanks to
Mike Williams) I knew that ACDSee wanted to start but then stopped because a
not mentioned error or immediatlely closed again.

Then I made a batchfile containing "C:\Program Files\acd
systems\acdsee\5.0\acdsee5.exe" and double-clicked that file, so it started
in a DOS-window. Petrik Salovaara mentioned command-prompt but didn't tell
me starting from DOSprompt.
Guess what? The system reported that a dll-file not could be found. I copied
that file to the dir where the batch-file was and double-clicked again. So
one by one I could trace all the files the system could not find.
After copying several files the app started through the DOS-prompt and also
through VB and is now working well.
I know, this will not be the perfect solution, I think there must be the
possibility to set a path to the dir where the dll's are (in the VB-script)
but in this moment good enough for me.
Maybe, I didn't try until now because lack of time, I can copy the file
acdsee5.exe to the dir where the dll's are?

So far this "adventure" in VB
Thanks again for all of your hints.
Vleugels
Satan's Evil Twin - 30 Jun 2004 18:40 GMT
Sounds like you need to "ChDir" to the folder where the EXE file exists (and
presumably the DLL's are) - "C:\Program Files\acd systems\acdsee\5.0\" -
before you shell the command line. This would also mean that you could do
without the path in your shell command and just run the EXE since the system
would already be in the proper folder.

> > >"Printing in VB6" problem. Come on Vleugels (and Rob). Tell us what your
> > >problem actually was and how you fixed it.
[quoted text clipped - 36 lines]
> Thanks again for all of your hints.
> Vleugels
Rick Rothstein - 30 Jun 2004 19:48 GMT
> Sounds like you need to "ChDir" to the folder where the EXE file exists (and
> presumably the DLL's are) - "C:\Program Files\acd systems\acdsee\5.0\" -
> before you shell the command line. This would also mean that you could do
> without the path in your shell command and just run the EXE since the system
> would already be in the proper folder.

If that is what is needed, then one shouldn't forget ChDrive either.

Rick - MVP
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.