Shell Command Deprecated?

Post Reply
bkorn
User
User
Posts: 12
Joined: Wed Mar 21, 2018 3:41 pm

Shell Command Deprecated?

Post by bkorn » Mon Dec 10, 2018 12:41 pm

I have a program that uses CMD to copy a file, but when I run the program in CMM 3.8, I get a dialog that says "Script run encountered an error". Since the program works fine in CMM 3.7, I'm guessing the Shell command that I am using to call command prompt has been deprecated in the new VB Script. If that is the case, what can I use instead?

User avatar
CrashN8
Site Admin
Site Admin
Posts: 242
Joined: Thu Feb 09, 2017 4:07 pm

Re: Shell Command Deprecated?

Post by CrashN8 » Mon Dec 10, 2018 4:43 pm

I have used xcopy.exe from External Command operation in CMM-Manager program. You can use VB Variable in External Command in case you have unique filename / path for each program execution. If time allows I'll post an example.

bkorn
User
User
Posts: 12
Joined: Wed Mar 21, 2018 3:41 pm

Re: Shell Command Deprecated?

Post by bkorn » Wed Dec 12, 2018 6:20 pm

So I take it that the Shell command has been deprecated then? If it has not I would prefer to use it, since that way I don't have to break up my VB script into two separate operations.

I do need to be able to use variables for the destination file name, and was not able to figure it out, so any explanation you have would be appreciated.

bkorn
User
User
Posts: 12
Joined: Wed Mar 21, 2018 3:41 pm

Re: Shell Command Deprecated?

Post by bkorn » Wed Dec 12, 2018 7:52 pm

I just discovered the File System Object copy method, which works great.

Code: Select all

Set FSO = CreateObject("Scripting.FileSystemObject")
Call FSO.CopyFile(source, destination)

User avatar
CrashN8
Site Admin
Site Admin
Posts: 242
Joined: Thu Feb 09, 2017 4:07 pm

Re: Shell Command Deprecated?

Post by CrashN8 » Thu Dec 13, 2018 5:00 pm

bkorn wrote:
Wed Dec 12, 2018 7:52 pm
I just discovered the File System Object copy method, which works great.

Code: Select all

Set FSO = CreateObject("Scripting.FileSystemObject")
Call FSO.CopyFile(source, destination)
This is great info... Thank you for your contribution to the forum, I have made this topic Sticky.

Post Reply