My script calls mutiple batch xml files in single .bat file script in command line while executing giving the input XXX.bat foldername userid and password(encrypted) servername then only it has to execute all the batch xml files ((script.bat set UN pwd server) in one line then hit enter it will execute the batch xml files) something like this.....
1) I removed the below lines to make it work but its not working as expected.
when I ran the script in command line giving input
script.bat set UN pwd server---in one line it is not launching the xml files when I just give the XXX.bat file name it is executing.could you please let me know how to achieve this? Is there any param file for windows batch script to encrypt the password
echo Enter Username and Password and server
set /p user_id=Enter UserID:
set /p password=Enter Password:
set /p server=Enter server:
if /i %user_id%==admin if /i %password%==password if /i %server%==server goto admin1
2) For below these lines I need to pass parameters like %1 %2 %3 %4 could you please let me know how to pass these parameters and use these in my script??
SET "user_Id= admin"
Modified Script (please let me know if anything to be modified)
For /f "tokens=1 delims=," %%i in (%Today%) do set user_id=%%i
For /f "tokens=2 delims=," %%j in (%Today%) do set password=%%j
For /f "tokens=3 delims=," %%k in (%Today%) do set server=%%k
For %%z in ("%xml_dir%\*.xml") do (
call scheduleBatch "%%z" %user_id% %password% %server%
if %errorlevel% == 1 >> %xml_error% echo "%%z" failed
if not %errorlevel% == 1 >> %xml_pass% echo "%%z" succeeded (Do you think I need to modify the error handling part too)
Please help me out.