Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch.nt    |    Fun with Windows NT batch files    |    68,980 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 67,993 of 68,980    |
|    Zaidy036 to icaro    |
|    Re: split a variable that contains a pat    |
|    01 Jan 23 15:32:03    |
   
   From: Zaidy036@air.isp.spam   
      
   On 1/1/2023 2:41 PM, icaro wrote:   
   > On Sun, 1 Jan 2023 08:28:37 +0100, "R.Wieser"    
   > wrote:   
   >   
   > Hi Rudy,   
   > you're right. I'm trying to make a backup script to sync some folders   
   > on my Windows PC via SSH to another Windows machine. Because Windows   
   > doesn't have a rsync client I've tried to keep aligned the directories   
   > with WinSCP commandline.   
   > Unfortunately WinSCP can't create nested paths using a single command   
   > like mkdir /c:/bk/dir1/dir2/dir3 but needs to proceed dir by dir (it   
   > does not have -p switch to make parent directories). This is why I   
   > need the weird output.   
   >   
   > Eventually I found a way to customize a script taken from   
   > StackOverflow   
   >   
   > @echo off   
   > setlocal enabledelayedexpansion   
   > set "out="   
   > set s=C:\Some\thing\not\so\useful   
   > set t=%s%   
   > :loop   
   > for /f "tokens=1* delims=\" %%a in ("%t%") do (   
   > set out=!out!/%%a   
   > if "!out:~-1!" NEQ ":" echo out = "!out!"   
   > set t=%%b   
   > )   
   > if defined t goto :loop   
   > setlocal disabledelayedexpansion   
   >   
   > This is the output:   
   > out = "/C:/Some"   
   > out = "/C:/Some/thing"   
   > out = "/C:/Some/thing/not"   
   > out = "/C:/Some/thing/not/so"   
   > out = "/C:/Some/thing/not/so/useful"   
   >   
   > Regards,   
   > icaro   
   >   
   >> "icaro"
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca