[RESOLVED] VB6, shell, and Windows 7
I have some code
Code:
Private Sub Form_Load()
MsgBox "DAD Launcher - 10/19/2011 10:00"
Dim filefrom As String
Dim FileTo As String
Dim Command As String
filefrom = "Z:\DAD\TECHNI.EXE"
FileTo = "C:\PROGRAM FILES\TECHNI\TECHNI.EXE"
'first copy file
FileCopy filefrom, FileTo
'now fire up the program
Command = "C:\PROGRAM FILES\TECHNI\TECHNI.EXE"
Shell Command, vbNormalNoFocus
End
End Sub
Everything seems to be working fine. However, when the users try to log in to the database they get an error "Cannot initialize SSPI package".
I moved everything to a directory under the Program Files directory because W7 seems to get all upset about running programs from the C: root.
If I manually copy the executable to their desktop and run it, they have no problem.
So, what would be the code to copy the program to the desktop and start it?
Re: VB6, shell, and Windows 7
Not enough information to diagnose your errors, but copying a program to the desktop (???) is very odd and copying it at all should not be necessary. Ideally you would find and fix your LUA bugs. LUA Buglight
As for how to do what you ask... how would it be different from what you're doing in the code you showed? Sadly even that is a little strange. Why aren't you using a proper setup package for deployment?
Re: VB6, shell, and Windows 7
I do have a proper setup program. It works just fine (on the XP computers). There is just something fishy going on with the Windows 7 units. Maybe copying it to desktop would not solve anything either. I have not tried it.
As for the "odd" program. I compile the code on my desktop and copy the executable to a shared directory on one of the servers. I can't have multiple users run a single executable. They would get an "in use" error. So this little program copies it to their local disk, That way, they don't affect the server and they have the latest version of the executable.
Again, if I run the executable on their PC manually, it works just fine. It is only when this "automated" version starts the program that I have the problems.
Re: VB6, shell, and Windows 7
I got it to work by taking out
CnxnPR.Properties("Integrated Security"). Value = "SSPI"
and replaced it with the properties of user ID & Password.