goto location on another drive
Posted: 10 Apr 2017 19:55
I am trying to get a script working that will take the selected folder and go the the same location on an identical drive and if that folder does not exist, create one.
here is the code I am using:
I get an error when trying to create a new path and if the path exists I get a "cannot be accessed" error.
Has anyone else done something like this?
here is the code I am using:
Code: Select all
// Check to see if selected is a folder
if (exists(<curitem>) == 2) {
$path = status "<curitem>";
// Change drives
$local = regexreplace($path, 'P:', 'J:');
status $local;
// If folder already exists go there
if (exists($local) == 2) {
goto $local
}
// If folder does not exists, create it then go there
else {
new("$local", "dir", , "r");
goto $local
}
}Has anyone else done something like this?