I have written a script to run on a server. I have access the the Windows server itself, but it does not have a GUI – it is just a command terminal. The script I need is saved on a USB Thumb drive, and I am struggling to copy it onto the server (which I have access to).
I have tried:
mkdir myFolder
copy script.txt C:\myFolder
In response to this, the server prints
Successfully Copied
But when I try
cd C:\myFolder
I get an invalid directory name error. What am I doing wrong?
You need to first create the directory, and then change to that drive and directory after copying. For instance, if your USB drive is
G:Change to drive
G:, create the folder onC:, and then copy the fileThen change to drive
C:and makeTargetFolderthe current directoryor, in one command:
Or, if you’re already on drive C: to start