'cmd' is not recognized as an internal or external command - while importing
Hi,
I am trying to use a bat script to import in a list. When I manually enter username and password in the script, it works fine but when I change it to read it from a .txt file, it shows the error: "'cmd' is not recognized as an internal or external command, operable program or batch file.". It's not like there is an error in reading from the .txt file. The user details are being picked up and the credentials are being formed as required by the connect script. Posting the codes below for better understanding:
Manually entered Username and Password: -- working
@Echo off
set AnaplanUser="Username:Password"
set WorkspaceId=<hidden>
set ModelId=<hidden>
set ServiceUrl="https://api.anaplan.com"
set AuthUrl="https://auth.anaplan.com"
set FileName="Trial Import.csv"
set FilePath="C:\Users\dishanka518\Documents\Anaplan_Connect\Files\Trial Import.csv"
set ImportName="Import Trial"
set DumpName="C:\Users\dishanka518\Documents\Anaplan_Connect\Error Dump\Trial Import.csv"
set Chunksize=1
set Operation=-debug -service %ServiceUrl% -auth %AuthUrl% -workspace %WorkspaceId% -model %ModelId% -chunksize %Chunksize% -file %FileName% -put %FilePath% -import %ImportName% -execute -output %DumpName%
rem *** End of settings - Do not edit below this line ***
setlocal enableextensions enabledelayedexpansion || exit /b 1
cd %~dp0
if not %AnaplanUser% == "" set Credentials=-user %AnaplanUser%
set Command=.\AnaplanClient.bat %Credentials% %Operation%
@Echo %Command%
cmd /c %Command%
pause
Importing while taking user details from a file: --- not working
@Echo off
@Echo off
set /A i=0
set path=""
set /A n=0
REM Reading from user detail File
set "file=C:\Users\username\Documents\Anaplan_Connect\Data\System Files\UserDetails.txt"
for /F "usebackq delims=" %%a in ("%file%") do (
set /A i+=1
call set user_arr[%%i%%]=%%a
call set n=%%i%%
)
REM Forming Anaplan Username:Password
set userid=%user_arr[1]%:%user_arr[2]%
REM Import Data into Anaplan
set AnaplanUser="%userid%"
set WorkspaceId=<hidden>
set ModelId=<hidden>
set ServiceUrl="https://api.anaplan.com"
set AuthUrl="https://auth.anaplan.com"
set FileName="Trial Import.csv"
set FilePath="C:\Users\username\Documents\Anaplan_Connect\Files\Trial Import.csv"
set ImportName="Import Trial"
set DumpName="C:\Users\username\Documents\Anaplan_Connect\Error Dump\Trial Import.csv"
set Chunksize=1
set Operation=-debug -service %ServiceUrl% -auth %AuthUrl% -workspace %WorkspaceId% -model %ModelId% -chunksize %Chunksize% -file %FileName% -put %FilePath% -import %ImportName% -execute -output %DumpName%
rem *** End of settings - Do not edit below this line ***
setlocal enableextensions enabledelayedexpansion || exit /b 1
cd %~dp0
if not %AnaplanUser% == "" set Credentials=-user %AnaplanUser%
set Command=.\AnaplanClient.bat %Credentials% %Operation%
@Echo %Command%
cmd /c %Command%
pause
Categories
- All Categories
- 2.3K Anaplan Community
- Academy
- Anaplan Talent Builder
- Model Design Course
- The Anaplan Way
- Archive
- 2 Idea exchange
- 62 Enterprise Scale
- 1.1K Extensibility
- 21 Intelligence
- 1.6K Planning & Modeling
- 331 Security
- Community Connections
- Connections
- Experiences
- Groups
- Personas
- Employees
- CS Toolkit
- Customer Care Center
- Forums
- Academy & Training
- Community Feedback & Updates
- Japan
- Anaplan Community Japan
- Anaplan Community Japan Knowledge Base
- HyperCare Japan
- JP-Central
- Support-Japanese
- Partners
- Partner Leadership Council
- Partner Product Council
- 724 Platform
- Anapedia
- App Hub
- Centers Of Excellence
- Extensions
- Planual
- Platform Updates
- 724 User Experience
- Profile Builder
- Resources
- Anaplan Advocates
- Anaplan Live!
- Community
- Community Advancement
- Community Connections
- Partner Program
- The Official Master Anaplanner Program
- Videos
- Welcome to the Anaplan Community!
- Success Central
- Support
- Case Portal Link
- Common Support Questions
- HyperCare Redirect
- Known Issues and Workarounds
- Support test page
- SupportFAQ
- Survey
- 2 Training Day Takeaways