Force delete Jenkins workspace on a windows machine from command line even if it is in use
up vote
0
down vote
favorite
I'm looking to delete a windows folder even if someone is accessing the folder, is that possible?
Here is where I encounter the issue in Jenkins. I'm trying to use a clean workspace for every Jenkins job and someone is logged on the Jenkins agent and has left the workspace folder open or it is open in command prompt, The Jenkins job always fails while cleaning up the workspace as it's in use and I need Jenkins to delete the folder even when it's use forcefully instead of failing. Is there some way I can hack or have a step to delete the workspace before the job starts even if it's in use. Any pointers are greatly appreciated.
Thanks!
windows jenkins folder devops workspace
add a comment |
up vote
0
down vote
favorite
I'm looking to delete a windows folder even if someone is accessing the folder, is that possible?
Here is where I encounter the issue in Jenkins. I'm trying to use a clean workspace for every Jenkins job and someone is logged on the Jenkins agent and has left the workspace folder open or it is open in command prompt, The Jenkins job always fails while cleaning up the workspace as it's in use and I need Jenkins to delete the folder even when it's use forcefully instead of failing. Is there some way I can hack or have a step to delete the workspace before the job starts even if it's in use. Any pointers are greatly appreciated.
Thanks!
windows jenkins folder devops workspace
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm looking to delete a windows folder even if someone is accessing the folder, is that possible?
Here is where I encounter the issue in Jenkins. I'm trying to use a clean workspace for every Jenkins job and someone is logged on the Jenkins agent and has left the workspace folder open or it is open in command prompt, The Jenkins job always fails while cleaning up the workspace as it's in use and I need Jenkins to delete the folder even when it's use forcefully instead of failing. Is there some way I can hack or have a step to delete the workspace before the job starts even if it's in use. Any pointers are greatly appreciated.
Thanks!
windows jenkins folder devops workspace
I'm looking to delete a windows folder even if someone is accessing the folder, is that possible?
Here is where I encounter the issue in Jenkins. I'm trying to use a clean workspace for every Jenkins job and someone is logged on the Jenkins agent and has left the workspace folder open or it is open in command prompt, The Jenkins job always fails while cleaning up the workspace as it's in use and I need Jenkins to delete the folder even when it's use forcefully instead of failing. Is there some way I can hack or have a step to delete the workspace before the job starts even if it's in use. Any pointers are greatly appreciated.
Thanks!
windows jenkins folder devops workspace
windows jenkins folder devops workspace
asked Nov 9 at 19:08
Jose
3013513
3013513
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
On Windows, if the user has the folder open from the command prompt it is essentially locked and that folder it self will not be able to be deleted.
If the folder is open in a file explorer windows I believe it is not locked as such and the folder can be deleted.
Thanks for the answer, already know about the lock. trying to see if there is a way to bypass the lock.
– Jose
Nov 14 at 2:27
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
On Windows, if the user has the folder open from the command prompt it is essentially locked and that folder it self will not be able to be deleted.
If the folder is open in a file explorer windows I believe it is not locked as such and the folder can be deleted.
Thanks for the answer, already know about the lock. trying to see if there is a way to bypass the lock.
– Jose
Nov 14 at 2:27
add a comment |
up vote
0
down vote
On Windows, if the user has the folder open from the command prompt it is essentially locked and that folder it self will not be able to be deleted.
If the folder is open in a file explorer windows I believe it is not locked as such and the folder can be deleted.
Thanks for the answer, already know about the lock. trying to see if there is a way to bypass the lock.
– Jose
Nov 14 at 2:27
add a comment |
up vote
0
down vote
up vote
0
down vote
On Windows, if the user has the folder open from the command prompt it is essentially locked and that folder it self will not be able to be deleted.
If the folder is open in a file explorer windows I believe it is not locked as such and the folder can be deleted.
On Windows, if the user has the folder open from the command prompt it is essentially locked and that folder it self will not be able to be deleted.
If the folder is open in a file explorer windows I believe it is not locked as such and the folder can be deleted.
answered Nov 13 at 2:34
Andrew Gray
2,08212139
2,08212139
Thanks for the answer, already know about the lock. trying to see if there is a way to bypass the lock.
– Jose
Nov 14 at 2:27
add a comment |
Thanks for the answer, already know about the lock. trying to see if there is a way to bypass the lock.
– Jose
Nov 14 at 2:27
Thanks for the answer, already know about the lock. trying to see if there is a way to bypass the lock.
– Jose
Nov 14 at 2:27
Thanks for the answer, already know about the lock. trying to see if there is a way to bypass the lock.
– Jose
Nov 14 at 2:27
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53231916%2fforce-delete-jenkins-workspace-on-a-windows-machine-from-command-line-even-if-it%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown