Due to the way our IT group has set up our servers, we are not allowed
to use the Shell() command.
We are already doing a similar action with an FTP command. Our code
is thus:
sExe = Environ$("COMSPEC")
sExe = Left(sExe, Len(sExe) - Len(Dir(sExe)))
sExe2 = sExe & "ftp.exe -s:" & Q & sScrFile & Q
ShellWait sExe2, vbNormalFocus
In the above example, Q = """" (don't ask me why...) and sScrFile is
the name of a text file which contains a list of commands.
Once we do this, we need to move a file from one directory to
another. We can't use the DOS "Move" command while in the FTP shell,
so we have to open a new instance in the CMD shell.
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.