
12-11-2007
|
|
|
|
Non esegue copy all'interno di applicazione VB6
Buonasera a tutti,
hoi il seguente problema: una applicazione in VB6 che funziona correttamente
con Win XP quando la eseguo in Vista non esegue comando all'interno alla
applicazione così definito
__________________________________________________ _________
comandobatch = "copy /b " & App.Path & "\docs\In\database.zip.001
c:\database.zip"
ReturnValue = Shell(StringaComando & " /c " & comandobatch, vbHide)
__________________________________________________ _____________
e anche
__________________________________________________ _____________
comandobatch = "copy /b c:\database.zip+" _
& App.Path & "\docs\In\database.zip." & suffisso & " " _
& "C:\database.zip"
__________________________________________________ ________
Ho provato ad eseguirli manualmente nel prompt dei comandi in Vista e
vengono eseguitio correttamente.
Prima dei copy nell'applicazione c'è anche una funzione di ricerca del
prompt dei comandi, come di seguito riportato
__________________________________________________ ______
Private Sub Command4_Click()
Dim StringaComando As String
On Error Resume Next
ReturnValue = Shell("cmd.exe /c")
If err.Number = 53 Then
err.Number = 0
ReturnValue = Shell("command.exe /c")
If err.Number = 53 Then
err.Number = 0
ReturnValue = Shell("command.com /c")
If err.Number = 53 Then
ReturnValue = ""
MsgBox "Impossibile trovare un comando valido per la ricomposizione
degli archivi."
Else
StringaComando = "command.com"
End If
Else
StringaComando = "command.exe"
End If
Else
StringaComando = "cmd.exe"
End If
err.Number = 0
On Error GoTo 0
__________________________________________________ _______
Grazie per l'attenzione, saluti.
|