I am by far not a scripting or code writer but I am attempting to backup multiple network devices (over 70). I have built two different files one called the master-backup.cmd and then the script.txt for WINScp. I am attempting to get it to backup to a drive as ipaddress.txt.timestamp the timestamp is working correctly but the ipaddress piece is not. In the main file I want to just simply put in multiple devices and run the script. The IP address piece on the backup file I am needing to be a wildcard to change depending on the device its connected to. I have the below in the script right now.
for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set LDT=%%j
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script=C:\Users\admin\Desktop\backupscript-test.txt /parameter scp://ubnt:ubnt@%HOST1%
option batch abort
option confirm off
option transfer binary
get system.cfg "E:\backup\%HOST*%.txt.%STAMP%"
I am attempting to get the %HOST*% to be the IP address of the host its connected to from /parameters piece. It currently saves the file as %HOSTm%.txt.20141223130100