Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » How to script renaming a directory? (Windows)
How to script renaming a directory? (Windows) [message #1778261] Tue, 12 December 2017 12:03 Go to next message
Andrew Small is currently offline Andrew SmallFriend
Messages: 3
Registered: December 2017
Junior Member
Part of the test step requires a missing folder scenario to be handled correctly. I am trying to rename the folder within the script. So far, without success as every variant returns "CreateProcess error=2, The system cannot find the file specified at exec-process (/getstarted/First Test.test:...)":


// Try 1: Direct call to command
exec-process -command "rename C:\\T32 T32_TEMP"

// Try 2: Create a batch (which works) and then call it (fails).
str "rename C:\\T32 T32_TEMP" | write-lines -uri "file:/Users/Public/Documents/core.bat"
wait 100
exec-process "file:/Users/Public/Documents/core.bat"

// Try 3: Access the existing batch file.
exec-process "file:/Users/Public/Documents/core.bat"


Running the batch file manually is successful.
Re: How to script renaming a directory? (Windows) [message #1778507 is a reply to message #1778261] Fri, 15 December 2017 12:02 Go to previous messageGo to next message
Viktoria Dlugopolskaya is currently offline Viktoria DlugopolskayaFriend
Messages: 124
Registered: March 2017
Senior Member
Hi Andrew,

Correct ecl command should be:
exec-process "C:\\Windows\\System32\\cmd.exe" "/C" "rename" "C:\\T32" "T32_TEMP"


RCPTT does not have 'rename' command, so if you want to do it via ECL, script should be:
copy-file "C:/T32" "C:/" "T32_TEMP"
delete-file "C:/T32"
Re: How to script renaming a directory? (Windows) [message #1778517 is a reply to message #1778507] Fri, 15 December 2017 15:11 Go to previous message
Andrew Small is currently offline Andrew SmallFriend
Messages: 3
Registered: December 2017
Junior Member
Thanks, I'd tried that command but without the (frankly bizarre) tokenisation. My workaround had been to write a batch file and then get the AUT to call it using Run/External Tools... Yours is more efficient, so I'll adopt it.

The copy/delete pattern would impact the test time as the directory has 1GB data.

Thanks for your help.
Previous Topic:Unable to Launch AUT from Jenkins using window batch command
Next Topic:Auto Completion/Code Recommendation on macOS
Goto Forum:
  


Current Time: Sat Aug 18 20:00:51 GMT 2018

Powered by FUDForum. Page generated in 0.01878 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top