Command Line Error

Hi Team - I’m pretty new to Robin for RPA. I have already written code which I’m trying to execute. Same code is running fine for other user but for me I’m getting an error as attached. Please help me solving this error. Thanks

Hi @RahulJakhmola14, welcome to the forum!
Can you please post your code? It’s hard to know what’s going wrong if there is no code to refer to.
Regards,
burque505

Hi @burque505- Below is the code Iam trying to execute.

Excel.LaunchAndOpen Path:“C:\Users\RA300371\Desktop\Book1.xlsx” Visible:True Password:’’ ReadOnly:False LoadAddInsAndMacros:False Instance=> ExcelInstance
Excel.ActivateWorksheetByName Instance:ExcelInstance Name: ‘Sheet1’
Excel.GetFirstFreeColumnRow Instance:ExcelInstance FirstFreeColumn=> FirstFreeColumn FirstFreeRow=> FirstFreeRow
Console.Write Message: FirstFreeColumn
Console.Write Message: FirstFreeRow
Excel.ReadCells Instance: ExcelInstance StartColumn: 1 StartRow: 1 EndColumn: FirstFreeColumn - 1 EndRow: FirstFreeRow - 1 ReadAsText:False FirstLineIsHeader:true Value=> ReposData
#Console.Write Message: ReposData[0][“Repo”]
Set DataCount to ReposData.Rows.Count
Set num to 0

loop while(DataCount > 0)

#-------------------------------Reaching Git Directory-----------------------------------
CommandLine.Open Directory:‘C:\GIT\’ Session=> Session

Console.Write Message: DataCount

#Console.Write Message: DataRow

Console.Write Message: ReposData[num][“Repo”]

#---------------------------------------Cloning Repository---------------------------------------

CommandLine.Write Session: Session Command: “git clone https://xyz.com/xyz/rpa/” + ReposData[num][“Repo”] + “.git” SendEnter:True
wait 20
CommandLine.ReadAndSplit Session: Session CmdOutput=> CmdOutputClone CmdError=> CmdErrorClone
Console.Write Message: CmdOutputClone
Console.Write Message: CmdErrorClone

#--------------------------------------Checking OF gitignore File Is Present Or Not-----------------
if(File.Exists File: ‘C:\Git\’+ ReposData[num][“Repo”] + ‘.gitignore’) then

console.Write Message: ‘Git Ignore File Already Exist Over New Repository’
#-------------gitgnore file is present over the given repository----------------------------------
else
Console.Write Message: ‘Inside Else’
File.Copy Files:‘C:\Git.gitignore’ Destination: ‘C:\Git\’+ ReposData[num][“Repo”] IfFileExists:File.IfExists.DoNothing CopiedFiles=> CopiedFiles
console.Write Message: ‘Git Ignore Copies Over New Repository’

#------------------------------------Adding File Over Git-------------------------------------
CommandLine.Open Directory:‘C:\Git\’+ ReposData[num][“Repo”] Session=> Session
CommandLine.Write Session:Session Command:‘git add --all’ SendEnter:True
Wait 15
CommandLine.ReadAndSplit Session: Session CmdOutput=> CmdOutputIgr CmdError=> CmdErrorIgr
Console.Write Message: CmdOutputIgr
Console.Write Message: CmdErrorIgr

#------------------------------------Commiting File Over Git----------------------------------
CommandLine.Write Session:Session Command:‘git commit -m “Initial Commit Approved By Partha”’ SendEnter:True
wait 40
CommandLine.ReadAndSplit Session: Session CmdOutput=> CmdOutputCommitIgr CmdError=> CmdErrorCommitIgr
Console.Write Message: CmdOutputCommitIgr
Console.Write Message: CmdErrorCommitIgr

#-------------------------------------Pushing File Over Git-----------------------------------------------
CommandLine.Write Session:Session Command:‘git push’ SendEnter:True
wait 40
CommandLine.ReadAndSplit Session: Session CmdOutput=> CmdOutputPushIgr CmdError=> CmdErrorPushIgr
Console.Write Message: CmdOutputPushIgr
Console.Write Message: CmdErrorPushIgr

end

#CommandLine.Write Session:Session Command:‘C:\Git\’+‘excel value\’+ ‘.gitignore’ + ‘.gitignore Is Not Present Over The Current Repository’ SendEnter:True

if( ReposData[num][“Old Repo Path”].tostring=’’ ) then

Console.Write Message: ‘Files Initial Location Is Not Given. Thus it is a New Repository’

else

Console.Write Message: ‘Files Initial Location Is pResent. Thus Code Need to be checked In’
#------------------------------------Copying File from Client Implementation to the Required Folder------------------------------------------
Console.Write Message: ‘robocopy "C:\Git\’ + ReposData[num][“Old Repo Path”] + ’ "’ + ’ "C:\GIT\’ + ReposData[num][“Repo”] + ‘\ " ’ + ‘/e’
CommandLine.Write Session: Session Command: ‘robocopy "C:\Git\’ + ReposData[num][“Old Repo Path”] + ’ "’ +’ "C:\GIT\’ + ReposData[num][“Repo”] + '\ " ’ + ‘/e’ SendEnter:True

With Double Quotes ----CommandLine.Write Session: Session Command:‘robocopy "C:\Git\’ + ReposData[num][“Old Repo Path”] + ‘"’ +’ “C:\GIT\’ + ReposData[num][“Repo”] + '” ’ + ‘/e’ SendEnter:True

#CommandLine.Write Session: Session Command:“robocopy “C:\Git\clientimplementations\Trunk\OCP Edits\OCP Edits 18.6_PROD\OCP_TaskEnrich” “C:\GIT\OCP_TaskEnrichment” /e” SendEnter:True
wait 15
CommandLine.ReadAndSplit Session:Session CmdOutput=> CmdOutputCopy CmdError=> CmdErrorCopy
Console.Write Message: CmdOutputCopy
Console.Write Message: CmdErrorCopy
CommandLine.Open Directory:‘C:\GIT\’ + ReposData[num][“Repo”] Session=> SessionNew

#------------------------------------Adding File Over Git-------------------------------------
CommandLine.Write Session:SessionNew Command:‘git add --all’ SendEnter:True
Wait 15
CommandLine.ReadAndSplit Session: SessionNew CmdOutput=> CmdOutputNew CmdError=> CmdErrorNew
Console.Write Message: CmdOutputNew
Console.Write Message: CmdErrorNew

#------------------------------------Commiting File Over Git----------------------------------
CommandLine.Write Session:SessionNew Command:‘git commit -m “Initial Commit Approved By Partha”’ SendEnter:True
wait 60
CommandLine.ReadAndSplit Session: SessionNew CmdOutput=> CmdOutputCommit CmdError=> CmdErrorCommit
Console.Write Message: CmdOutputCommit
Console.Write Message: CmdErrorCommit

#-------------------------------------Pushing File Over Git-----------------------------------------------
CommandLine.Write Session:SessionNew Command:‘git push’ SendEnter:True
wait 60
CommandLine.ReadAndSplit Session: SessionNew CmdOutput=> CmdOutputPush CmdError=> CmdErrorPush
Console.Write Message: CmdOutputPush
Console.Write Message: CmdErrorPush

end

Set DataCount to DataCount - 1
Set num to num + 1

end

CommandLine.Close Session: Session
Excel.Close Instance: ExcelInstance

Hi @RahulJakhmola14, is the other user you mention perhaps using a previous version of Robin? If you could find out that would be very helpful. My version of Robin (0.93, from March 9, 2020), does not have a module that would allow

CommandLine.Open Directory:‘C:\GIT\’ Session=> Session

The Standard Modules page in the documentation does have a heading still for ‘CommandLine’ but clicking on it gives a 404 error.

The last time I recall using ‘CommandLine’ was in December 2019, and I’m fairly sure that was using version 0.92.

Regards,
burque505

1 Like

Hi @burque505 Sorry for that much delay in response. Sure will check the version with user[currently he is on PTO and will be back next week]. Once I have the version he is using, I would definitely let you know. Thanks for helping me on this :slight_smile:

1 Like