/build/static/layout/Breadcrumb_cap_w.png

FileZilla 3.5.3 script doubt

if not exist %SystemDrive%\install\Logs\ md %SystemDrive%\install\Logs\

"%~dp0FileZilla_3.5.3_win32-setup.exe" /S

pushd "c:\users"

for /f "tokens=* delims= " %%a in ('dir /b/ad') do (

IF NOT EXIST "%%a\AppData\Roaming\FileZilla" (

mkdir "%%a\AppData\Roaming\FileZilla"

copy %~dp0FileZilla.xml "%%a\AppData\Roaming\FileZilla"

)

)

Del /q "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\FileZilla FTP Client\Uninstall.lnk"

REM Return exit code to SCCM

exit /B %EXIT_CODE%

could any body explain me in the above script how it is copying my custom xml file (FileZilla.xml) to allusers, I found this in ITNINJA notes for FileZilla. I did some research about "%%a" command here used but not clear enough 

Any help would be appretiated 

TY


0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
pushd "C:\Users" is making the current directory as C:\Users like cd C:\Users command dir /b/ad is listing out the folder names that are available under C:\Users folder For Example Administrator User1 User2 Test Test1 Public Default User Default All Users etc.. So, Here %%a means C:\Users\\ ------------------------------------- IF NOT EXIST "%%a\Application Data\FileZilla" ( mkdir "%%a\Application Data\FileZilla" copy %~dp0FileZilla.xml "%%a\Application Data\FileZilla" ------------------------------------- Checking that the above listed User's folders contains "AppData\FileZilla" folder or not If the folder "AppData\FileZilla" is not exist under Users folder then it is creating it and copying the xml file to \Appdata\FileZilla folder It is not checking whether the listed User name folders are valid user's profile or not.. What happens to the copying part if the machines has \AppData\FileZilla folder.. It will not copy the xml file.
Posted by: jagadeish 12 years ago
Red Belt
2

pushd "C:\Users" is making the current directory as C:\Users like cd C:\Users command

dir /b/ad is listing out the folder names that are available under C:\Users folder

For Example

Administrator
User1
User2
Test
Test1
Public
Default User
Default
All Users
etc..

So, Here %%a means C:\Users\<The folders available in C:\Users folder>\


-------------------------------------
IF NOT EXIST "%%a\Application Data\FileZilla" (

mkdir "%%a\Application Data\FileZilla"

copy %~dp0FileZilla.xml "%%a\Application Data\FileZilla"
-------------------------------------


Checking that the above listed User's folders contains "AppData\FileZilla" folder or not
If the folder "AppData\FileZilla" is not exist under Users folder then it is creating it and copying the xml file to <UserName>\Appdata\FileZilla folder

 

It is not checking whether the listed User name folders are valid user's profile or not..
What happens to the copying part if the machines has <UserName>\AppData\FileZilla folder.. It will not copy the xml file.


 


Comments:
  • Excellent Thank you so much, I really appreciate it - ontari.ontari 12 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ