• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 430
  • Last Modified:

ExecCmd ("cmd.exe /c Copy ...)

Need help with "ExecCmd()".  What is its purpose and can anyone decipher what might be happening in this line?  I guess the question marks are legal syntax since I am not getting any errors from the shell.  I am trying to figure out someone elses code.

ExecCmd ("cmd.exe /c Copy " & l_Path & "Tensil.txt + " & l_Path & rsPos!SapRoll & "???M.rep + " & l_Path & rsPos!SapRoll & "???T.rep " & l_Path & "Tensil.txt")

1 Solution
I guess
l_Path is a variable the holds a directory path (eg "C:\Mydata\")

rsPos is a recordset of some sort
SapRoll is a field in rsPos that holds some further path/file info (eg "MyFile")
 the ??? are  Wild card characters  

so the code is copying files

and any  files that begin with value of rsPos!SapRoll with 3 characters followed by either T.rep or M.rep
from I_Path
to a single file - Tensil.txt - in the same directory


Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now