I am trying to write a batch file to do the following:
Here is what I have so far:
@ECHO OFF
ECHO "%~1"
ECHO "Uploading File..."
COPY "%~1" "PATH_TO_NETWORK_DRIVE"
SET "path=PATH_TO_NETWORK_DRIVE"
SET "file=%~nx1"
SET "link=%path%%file%"
ECHO %link%> "I:\filepath.txt"
START "I:\filepath.txt"
The above works in so far as the file is copied to the correct location and the text file is created containing the path string. I'm only using an external text file and the START command above purely because I've hit a road block in getting the text file to copy to the clipboard, trying numerous variations of the CLIP command. I've tried:
ECHO %link%| clip
clip < "I:\filepath.txt"
type "I:\filepath.txt" | clip
None of the above are working for me, despite other threads on here suggesting that they should. Is there a limitation in using CLIP in a batch file? Is there any workaround to this? Any assistance I can get would be hugely appreciated :)
You're wiping out your system path
with this statement, so your batch file probably can't find CLIP.EXE
.
SET "path=PATH_TO_NETWORK_DRIVE"
Change it to mypath
(or any other name):
SET "mypath=PATH_TO_NETWORK_DRIVE"
Also, change all of your references from %path%
to %mypath%
.