Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Windows Scripting to copy files

$
0
0

Hi there,

New to Windows scripting. 

I have tried to create a simple script to copy file but failed. Most probably the syntax is wrong. Pls help. thanks.

I give you my code below:

@ECHO OFF
SETLOCAL

REM SET INDIR="\\sge-fs01\enablers_development\ptc\OUTGOING"
SET SLIFTCMD="C:\Program Files\PrivyLink\SLIFT-Ez Classic\1.4\SLIFTC.exe"
SET PFX="C:\PrivyLink\KeyPeer\111111.pfx"
SET PFXPWD="pass12345"
SET CER="C:\PrivyLink\KeyPeer\sgesftpuser.cer"
SET PATTERN="*.IN"
SET DSTDIR="C:\SFTP\OUTBOUND"
SET BKDIR="C:\SFTP\BACKUP"
SET SENDDIR="C:\SFTP\SENDTO"
SET INDIR="C:\SFTP\PTC\OUTGOING"

REM ####### MAIN CALL #########
CALL:MainScript
GOTO :EOF

REM ####### Check Files in PTC OUTGOING #########
:MainScript
SETLOCAL

@ECHO OFF
PUSHD %INDIR%
IF EXIST "C:\SFTP\PTC\OUTGOING\*.IN"
(   
COPY "C:\SFTP\PTC\OUTGOING\*.IN" %DSTDIR%


ELSE 
(
      echo "There are no files today - %date:~-4,4%%date:~-7,2%%date:~-10,2%" >> C:\SFTP\PTC.log
pushd %~dp0
start "" cmd /c cscript SMTP.vbs

)       


POPD
ENDLOCAL
GOTO :EOF

REM ####  END ########


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>