John Mishefske wrote:
ManningFan wrote:
>My code is thus:
sExe3 = sExe & "cmd.exe -s:" & sScrFile2
ShellWait sExe3, vbNormalFocus
All it does is open a CMD window and sit there, it's not processing
the text file I'm sending it like the FTP shell does.
Anyone know why? Can you fix my code? Any help is appreciated.
I think that this line:
sExe3 = sExe & "cmd.exe -s:" & sScrFile2
should be using sExe2 instead?
sExe3 = sExe2 & "cmd.exe -s:" & sScrFile2
I should have read your post more carefully but your move command is
probably expanding to something like this:
(assuming) ComSpec=C:\WINDOWS\system32\cmd.exe and "test.txt" as sScrFile2
The code line:
sExe3 = sExe & "cmd.exe -s:" & sScrFile2
expands to:
cmd.execmd.exe -s: filename
So... you can see there are several issues here:
- cmd.exe provided twice
- there is no -s: would be an invalid cmd option
You might want to try:
sExe & " move " & sScrFile2 & " " & sDestination
or better yet, use the Name statement in VBA to move your file.
--
'--------------------------
' John Mishefske
' UtterAccess Editor
' 2007 Microsoft Access MVP
'--------------------------