well it must be the way Visual Basic 6 calls the shell that win10 doesn't like.
maybe shell32.dll is the key???
any of these lines in the unpacking code could be the problem...
Private m_strCommandCom As String
Set m_xobjFunc = New GBFuncs.clsFunctions
m_strCommandCom = m_xobjFunc.Long2Short(Environ$("COMSPEC")) & " /c "
Dim strCommandLine As String
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function SHFileOperation Lib
"shell32.dll" Alias " SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Private Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As Any, lpThreadAttributes As Any, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
' x extract with full paths
' -y answer yes on all queries
' -r recurse directories
' -o output folder
' (7-zip help file recommends using long filenames, as short [8.3] ones may not work 100% of the time)
strCommandLine = m_strCommandCom & strExtractorPath_in & " x """ & strFile_in & """ -y -r -o""" & strDestPath_in & "\"""
Call LogStatus("Running 7-Zip [" & strCommandLine & "]")
lngRetVal = CreateProcess(sNull, strCommandLine, ByVal 0&, ByVal 0&, 1&, NORMAL_PRIORITY_CLASS, ByVal 0&, sNull, sInfo, pInfo)
lngRetVal = WaitForSingleObject(pInfo.hProcess, INFINITE)
-------------------
searching online i found possible new command-line code that might work in win10.
You can use the Shell command. To execute internal DOS command (Dir, Copy,
etc. as well as redirection of screen output), the command processor must be
specified (using the Environ$ function and "comspec" as its argument returns
the correct command processor path on NT and non-NT systems) . Specifying
the command processor is safe & generic and will work with non-internal
commands also. That syntax, using an XCopy command as an example is:
Shell Environ$("comspec") & " /c xcopy """ & _
Source & """ """ & Destination & """ " & Option, vbHide
Shell Environ("comspec") _
& " /k " & Chr(34) & myFileName & Chr(34) & " " & myparms, vbNormalFocus
Use /c says to close that (hidden!) window when it's done.
The /k to see the command window (/k = keep open).
--------------------
Re: vb6 and the shell command.
Code:
Option Explicit '<-- ENABLE THIS ALWAYS!!! See What is Option Explicit, and why should I use it?
Private Sub Command1_Click()
Dim sCmdLine As String 'See Understanding the Scope of Variables
Dim sExeDir As String
sExeDir = """" & App.Path & "\mailsend\"
sCmdLine = sExeDir & "mailsend.exe""" & _
" -f " & sExeDir & "attach.txt""" & _
" -from
bcenterprises@thicomm.com" & _
" -smtp smtp.1and1.com" & _
" -port 587" & _
" -auth LOGIN
bcenterprises@thicomm.com •••••••••••" & _
" -to
matt@thicomm.com" & _
" -msg ""test 123"""
MsgBox sExeDir & vbNewLine & vbNewLine & sCmdLine, vbInformation
Shell sCmdLine, vbNormalFocus
End Sub
-------------------------
Notice how quotation marks are embedded in the string by adding another quotation mark.
are there any coders out there that can confirm it works with vb6?