- 1 year ago
"Drive already SUBSTed" on deletion of virtual drive in jenkins pipeline on a windows server
The error message "Drive already SUBSTed" usually occurs when you try to use the subst
command to map a virtual drive to a path that is already mapped to another virtual drive.
In a Jenkins pipeline on a Windows server, you can use the following steps to delete a virtual drive mapped using subst
:
Use the
subst
command to list all the currently mapped virtual drives:batsubst
This will output a list of virtual drives currently mapped to paths.
Find the virtual drive you want to delete in the output of the
subst
command.Use the
subst
command to delete the virtual drive by specifying the drive letter followed by the/d
option:batsubst X: /d
Replace
X:
with the drive letter of the virtual drive you want to delete.
If you are encountering the "Drive already SUBSTed" error message, it means that the virtual drive you are trying to delete is already mapped to a different path or drive letter. In this case, you can either delete the other virtual drive first, or choose a different drive letter for the virtual drive you want to create.
If the issue persists, you can try running the Jenkins pipeline with elevated privileges (i.e., "Run as administrator") to ensure that you have sufficient permissions to create and delete virtual drives.