Avatar of Mike Minchinton
Mike Minchinton
Flag for United States of America

asked on 

Need a script that will create its own directory to dump logs into

So I have this script below, and when it goes and retrieves logs, I need it to actually create its own directory in a folder in the C: drive.   I have attached the script.

Anybody have any ideas on how I can make it create a directory each log dump?


SCRIPT:
Echo OFF
Echo "Copy Flex Terminal Log files.  Press Any Key If You Think You Can Handle It"

:NO
SET /p FN=Enter Flex Name:
Echo You Entered - %FN%
@ECHO OFF

:choice
set /P c=Is this correct Flex Name(Y/N)?
if /I "%c%" EQU "Y" goto :yes
if /I "%c%" EQU "N" goto :NO
goto :choice
Pause

:yes
SET /p DATE=Enter Date(mm-dd-yyyy):
Echo You Entered - %DATE%
:choice
set /P c=Is this correct date(Y/N)?
if /I "%c%" EQU "Y" goto :RUN
if /I "%c%" EQU "N" goto :YES
goto :choice
Pause

:RUN
net use \\%FN% PASSWORD /user:DOMAIN\USERNAME

xcopy "\\%FN%\c$\CGTDeviceManager\Logs" "C:\Users\USERNAME\Desktop\ZIPS" /D:%DATE%
xcopy "\\%FN%\c$\Program Files\Primeline Enterprise\Applications" "C:\Users\USERNAME\Desktop\ZIPS" /D:%DATE%
***xcopy "\\%FN%\c$\Users\ser-flexuser\AppData\Roaming\FlexTerminalClient\Local Store" "C:\Users\USERNAME\Desktop\ZIPS" /D:%DATE%***
xcopy "\\%FN%\c$\Documents and Settings\ser-flexuser\Application Data\FlexTerminalClient\Local Store" "C:\Users\USERNAME\Desktop\ZIPS" /D:%DATE%

Pause

Open in new window

Scripting Languages

Avatar of undefined
Last Comment
Bill Prew

8/22/2022 - Mon