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

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.
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

1

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.


 

Answered 07/31/2012 by: jagadeish
Red Belt

  • Excellent Thank you so much, I really appreciate it
Please log in to comment
Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share