1
I am with a personal project that aims to automate the process of creating folders of the services I provide. Currently my goal is to create 2 basic script for the Prompt Windows, where it automatically creates a series of standardized folders and copies certain common files from a predefined folder to the newly created folder.
Currently my script is as follows:
@echo off
set /p ano="Entre o Ano a ser criado:"
mkdir %ano%\1.JANEIRO %ano%\2.FEVEREIRO %ano%\3.MARCO %ano%\4.ABRIL %ano%\5.MAIO %ano%\6.JUNHO %ano%\7.JULHO %ano%\8.AGOSTO %ano%\9.SETEMBRO %ano%\10.OUTUBRO %ano%\11.NOVEMBRO %ano%\12.DEZEMBRO
cd %ano%\1.JANEIRO
copy "C:\Users\joao.salvador\Documents\2.SERVIÇOS\00.DOCUMENTOS_PADROES\*.xlsx"
timeout 60
The problem is that when I run this Script, the system creates the folders correctly but when trying to copy the files returns the message:
O sistema não pode encontrar o caminho especificado.
The strange part is that when I open the Promt and use the same copy code, it works normally, as demonstrated by the Log below:
C:\Users\joao.salvador\Documents\2.SERVIÇOS>copy "C:\Users\joao.salvador\Documents\2.SERVIÇOS\00.DOCUMENTOS_PADROES\*.xlsx"
C:\Users\joao.salvador\Documents\2.SERVIÇOS\00.DOCUMENTOS_PADROES\AVBR_Formulario de Reembolso de Despesas de Viagens - Cartao Corporativo.xlsx
C:\Users\joao.salvador\Documents\2.SERVIÇOS\00.DOCUMENTOS_PADROES\AVBR_Formulario de Reembolso de Despesas de Viagens - Reembolso de Despesas.xlsx
C:\Users\joao.salvador\Documents\2.SERVIÇOS\00.DOCUMENTOS_PADROES\ServiceReport_default.xlsx
3 arquivo(s) copiado(s).
In my research, I found people quoting to be used xcopy instead of copy, for being a more "stable version of it, but try, I still have a similar problem where it returns me the message:
Arquivo não encontrado - *.xlsx 0 arquivo(s) copiado(s)
Any idea why this strange behavior?
Additional Information:
This script is simply a file with extension .cmd
My operating system is a Windows 10 Pro