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

Problem to line

I get error

File name does exist

to line

Shell (Command0)

Open in new window

while Command0 is having value

rename "C:\cmp3g\CODECO_ERROR_a\CNESI_CNSNHEPI_20171108095055_958.ERR" "CNESI_CNSNHEPI_20171108095055_958.edi" 

Open in new window

HuaMin Chen
HuaMin Chen
1 Solution
Bill PrewCommented:
The RENAME command is not an actual program (.EXE) in Windows, but rather just a command that is available from the command interpreter.  To use it you need to load the command interpreter first and then pass it the command to execute.  Adjust as bellow before the Shell() command.  You can do CMD /H at a command prompt to get additional info on it's command line options.

Also since we want to include the double quotes around the file names in the command0 string, we have to double them up inside the outermost double quotes.

Command0 = "cmd /c rename ""C:\cmp3g\CODECO_ERROR_a\CNESI_CNSNHEPI_20171108095055_958.ERR"" ""CNESI_CNSNHEPI_20171108095055_958.edi"""

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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