Skip to content

SMB

The SMB action works with files on Windows network shares (\\server\share\folder, e.g. a NAS or a file server) and in folders on this PC. It copies, moves, lists or deletes files. Source and destination can be combined freely: from the PC to the share, from the share to the PC, or from one share to another.

To make this reliable, the action does the following:

  • Signs in only when needed. Without User, RUNOS accesses the share as the signed-in Windows user, like Explorer does. With User and Password, RUNOS signs in to every share involved for the duration of the action and signs out afterwards. Existing Windows connections (Explorer, mapped drives) are never disconnected.
  • Copies are written under a temporary name (name.part), checked by size and only then renamed. A file trigger watching the destination folder never sees half a file.
  • A move within the same share or drive is a rename: done at once, even for large files, and never half done. Otherwise the file is copied and checked first; the source is deleted only after that.
  • One failed file does not stop the others. At the end the action fails if a file failed or the sign-in did not work. As with every action, the run then ends or the workflow’s error handling applies (e.g. three retries with RetryThenNotify).
  • Missing folders at the destination are created. Hidden and system files (desktop.ini, Thumbs.db) are skipped.

In the workflow editor you put the action together in a form and try it with Test step.

{
"Type": "SMB",
"Name": "StoreInvoice",
"Parameters": {
"Operation": "Copy",
"Source": "{{FilePath}}",
"Destination": "\\\\nas\\accounting\\Invoices\\%yyyy%",
"User": "{{connector.NAS.Username}}",
"Password": "{{connector.NAS.Password}}"
}
}

In JSON every \ is doubled: "\\\\nas\\accounting" stands for \\nas\accounting.

Parameter Default Meaning
Operation Copy Copy, Move, List or Delete
Source – What is copied, moved, listed or deleted, see below. Required.
Destination – Copy/Move: the target folder, on this PC (C:\Archive) or on a share (\\nas\archive). Required.
Filter * If Source is a folder: only these files, e.g. *.pdf;*.xml
Recursive false Include subfolders; their structure is kept at the destination
IfExists Overwrite The target file exists already: Overwrite, Skip (counts as Skipped), Rename (keep both: the new one is called name (2).pdf, name (3).pdf …) or Error (counts as an error)
NewName – Copy/Move: name of the file at the destination. Knows %filename%, %filenamewithoutextension%, %extension% (of each file) and %yyyy%, %MM%, %dd%, %HH%, %mm%, %ss%.
User – User for the shares: DOMAIN\user, user@domain or, for a NAS, simply user. Empty = the signed-in Windows user.
Password – Password of User

Source is a file, a folder or a pattern, on this PC or on a share; several separated by ;:

  • File: {{FilePath}} or \\nas\inbox\order.xml
  • Folder: \\nas\inbox: its files that match Filter (with Recursive also those in subfolders)
  • Pattern: \\nas\inbox\*.xml

A file or folder that does not exist is an error; a pattern that matches nothing is not. Source can also be a list, such as the files of a trigger or {{ListFiles.Response.Files}} from an earlier List action.

Delete only deletes files, never folders. List lists the files.

Placeholders in paths: {{FilePath}}, {{InitialData…}}, connectors and %yyyy%, %MM%, %dd% (e.g. \\nas\archive\%yyyy%\%MM%) are replaced before the run.

User and Password only apply to network paths (\\server\share\…). RUNOS cannot set a user for drive letters such as Z:\; use the share’s UNC path instead.

Windows allows only one sign-in per server at a time. If Windows is already connected to the server as another user (for example through a mapped drive in Explorer):

  • If that connection can open the share, RUNOS uses it and adds a warning to the result.
  • Otherwise the action fails with a message saying so. Then disconnect the other connection (net use), or address the server by another name, e.g. its IP address (\\192.168.1.20\archive).

If several workflows use the same share at the same time, they share the sign-in; they must then use the same user.

"Response": {
"Results": [
{
"Source": "C:\\RUNOS\\Spooler\\…\\INV-2026-0001.pdf",
"Destination": "\\\\nas\\accounting\\Invoices\\2026\\INV-2026-0001.pdf",
"Size": 48211,
"Status": "OK",
"Message": ""
}
],
"SuccessCount": 1,
"SkippedCount": 0,
"ErrorCount": 0
},
"Meta": {
"Host": "PC-01",
"User": "OFFICE\\scanner",
"Shares": [ "\\\\nas\\accounting" ]
}

Status is OK, Skipped (exists already, IfExists: Skip) or Error with the reason in Message. Destination is the file actually written (so with IfExists: Rename e.g. INV-2026-0001 (2).pdf). List returns the files in Files instead, each with Name, Path, Size (bytes) and Modified. A following action reads them as {{ListFiles.Response.Files}}, e.g. in a Loop.

In the diagram of the workflow editor the action has a form (in the settings panel and in the middle column of the test view):

  • Operation Copy, Move, List or Delete; Source; Target folder (copy and move); Filter; Include subfolders.
  • If the file exists: Overwrite, Skip, Keep both (rename) or Fail; New name with %filename%, %yyyy% etc.
  • Sign-in: user (DOMAIN\user or user@domain; empty = the Windows user) and password.

Every field also takes {{…}} placeholders and values you drag in from the Input column of the test view; lists, switches and number fields become a text field when given a {{…}}. Parameters the form does not know are kept under Other parameters. Test step runs the action once, right away, with the data of the earlier steps, and shows the result with errors and warnings. The test really copies, moves or deletes. With List the output shows what is on the share under Response.Files.

Store every invoice on the NAS. A file trigger takes every PDF from the export folder and copies it to a folder per year on the NAS. If the file is there already, both are kept. Three retries in case the NAS is briefly unreachable:

{
"Name": "Store invoices",
"Autostart": true,
"Trigger": { "Type": "File", "Name": "Export", "Parameters": { "Pool": "C:\\Export\\Invoices", "Filter": "*.pdf" } },
"Actions": [
{
"Type": "SMB",
"Name": "Store",
"OnErrorPolicy": { "Strategy": "RetryThenNotify", "MaxRetries": 3, "InitialDelaySeconds": 30 },
"Parameters": {
"Operation": "Copy",
"Source": "{{FilePath}}",
"Destination": "\\\\nas\\accounting\\Invoices\\%yyyy%",
"IfExists": "Rename",
"User": "{{connector.NAS.Username}}",
"Password": "{{connector.NAS.Password}}"
}
}
]
}

Collect scans every night. Fetch all PDFs from the share’s scan folder to this PC and remove them there (Move), with the date in the name. Because copies arrive under a temporary name, a workflow watching C:\Import\Scans only sees complete files:

{
"Name": "Collect scans",
"Autostart": true,
"Trigger": { "Type": "Time", "Name": "Nightly", "Parameters": { "CronExpression": "0 0 2 * * ?" } },
"Actions": [
{
"Type": "SMB",
"Name": "Collect",
"Parameters": {
"Operation": "Move",
"Source": "\\\\fileserver\\scans\\*.pdf",
"Destination": "C:\\Import\\Scans",
"NewName": "%yyyy%-%MM%-%dd%_%filename%",
"User": "{{connector.Fileserver.Username}}",
"Password": "{{connector.Fileserver.Password}}"
}
}
]
}