bool MoveDirectory(string, string)

Moves or renames a directory

Security

Trust Level Required: Full Trust

Parameters

Name Description
from string
The old path of the directory.
to string
The new path of the directory.

Return

True upon success, and false if the directory did not exist.

Remarks

The target directory will be created. If the target directory already exists, then the initial directory will not be moved. Creating a file or directory in the UserData Directory will ensure that the file exists in all users with access to the C:. This is useful for testing settings as an admin user and running a kiosk as a separate, standard user. The variables needed to access KioWare Client's data directories are used in the following example. The kiosk user must have sufficient permissions to perform any file IO operation that performs a read or write operation on the current disk.

Examples


var userDataDir = KioApp.DoUrlSubstitution('$$KIO_USERDATA$$') + 'newDir';
var programDataDir = KioApp.DoUrlSubstitution('$$KIO_PROGDATA$$')  + 'newDir';
if(KioFileIO.CreateDirectory(userDataDir))
    var directoryInfo = KioFileIO.MoveDirectory(userDataDir, programDataDir);
else KioFileIO.MoveDirectory(userDataDir, programDataDir);
    

Requirements

KioWare for Windows version 8.5 or greater.