Siemens TIA Portal License Transfer Error: Cannot Write to Drive

David Krause14 min read
SiemensTIA PortalTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Siemens TIA Portal License Transfer Error: "Cannot Write to the Data Medium in Drive E:"

The Automation License Manager (ALM) from Siemens is the central service that manages license keys for the TIA Portal, STEP 7, WinCC, SINAMICS Startdrive, and the entire SIMATIC software family. When transferring a license key from the red Siemens license USB stick to a local hard drive (typically D:\ or C:\), engineers frequently encounter a dialog stating "None or not all license keys transferred". Pressing the Details button reveals the specific failure cause — most often "Cannot write to the data medium in drive E:". This article walks through every verified root cause, diagnostic check, and corrective action for this ALM transfer failure.

Engineering notice: The Automation License Manager is built on Wibu-Systems CodeMeter technology. The red Siemens license USB stick is a CodeMeter Stick (CmStick) with a dedicated, non-standard file system. Treating it as a generic removable drive will produce the error described above.

1. Problem Description and Error Context

1.1 User-Visible Symptoms

When the engineer executes ALM → Edit → Connect Target System, selects the USB CmStick as the source, the local hard drive as the target, and clicks Transfer, one of the following dialogs appears:

  • Primary message: None or not all license keys transferred. Customer Information.
  • Detail string (Details button): Cannot write to the data medium in drive E: — or whatever drive letter Windows has assigned to the source stick.
  • Alternate detail strings reported in the field:
    • The media is write protected.
    • There is not enough space on the disk.
    • The system cannot find the path specified.
    • License server is not running.

1.2 Identifying the Affected Drive Letter

ALM always reports the Windows-assigned drive letter, not the ALM logical container. If the USB stick is mounted as E: the error string ends with in drive E:. Verify the actual assignment through Windows Explorer → This PC or with the following command in an elevated PowerShell prompt:

Get-WmiObject Win32_LogicalDisk | Where-Object {$_.DriveType -eq 2} | Select-Object DeviceID, VolumeName, FreeSpace, Size

Identify the DeviceID (e.g., E:) and confirm the VolumeName matches the expected Siemens license volume label (typically CMSTICK or simply blank with a single WIBU-K partition).

2. Automation License Manager Architecture

Understanding the architecture is essential to interpreting the error. The ALM is composed of three logical layers:

Layer Component Default Location
Service CodeMeter Runtime (Wibu-Systems) C:\Program Files (x86)\CodeMeter\Runtime\bin\CodeMeter.exe
Service Siemens ALM Service C:\Program Files (x86)\Siemens\Automation License Manager\almservice.exe
GUI ALM Manager UI C:\Program Files (x86)\Siemens\Automation License Manager\alm.exe
Local license store License container repository %ProgramData%\Siemens\Automation License Manager\Local\
Log directory ALM trace logs %ProgramData%\Siemens\Automation License Manager\Log\
Registry ALM configuration HKLM\SOFTWARE\Siemens\Automation License Manager and HKLM\SOFTWARE\WOW6432Node\Siemens\Automation License Manager

When a transfer is initiated, the ALM GUI issues an RPC call to the almservice.exe, which in turn invokes CodeMeter.exe to read the source container from the USB CmStick and write a new container to the destination Local\ folder. If any of these layers cannot physically write a file to the destination medium, the error string is bubbled back to the GUI verbatim.

Wibu-Systems context: The Siemens red USB license stick is a CodeMeter (CmStick/S) device. It is not a standard mass storage device and only exposes a small FAT12/16 partition when its physical write-protect slider is unlocked. The CmDongle (USB dongle) variant is a smart card and does not present a drive letter at all — attempting to read it as a removable disk will always fail.

3. Root Cause Analysis: Why "Cannot Write to the Data Medium" Occurs

The error string is generic. Based on field diagnostics, the actual root cause is one of the following, listed in descending frequency:

# Root Cause Diagnostic Indicator Fix Path
1 ALM not running with administrative rights Transfer works for an admin user, fails for standard user Re-launch ALM as Administrator
2 Destination drive lacks write permission Folder ACL on D:\ excludes the user Grant Modify permission to BUILTIN\Users
3 USB stick is write-protected (physical slider or registry) Slider in lock position OR WriteProtect=1 in registry Slide physical lock to unlock, remove registry key
4 CodeMeter Runtime service stopped or hung services.msc shows CodeMeter not running Restart service, reboot PC
5 ALM service version mismatch with TIA Portal ALM V6.0 in use with TIA Portal V18 Install current ALM from Siemens support
6 Corrupted license container on source Check function reports CRC error Re-image stick via Siemens license generator
7 USB stick mounted read-only by Windows policy Group Policy → Removable Disks: Deny write Override policy or contact IT
8 Antivirus / EDR is intercepting CmStick writes CrowdStrike, Defender, Sentinel blocking almservice.exe Add ALM folders to AV exclusion list

4. Pre-Transfer Diagnostic Checklist

Before any modification, run the following four checks. They eliminate 80% of the cases in less than five minutes.

  1. Verify CodeMeter service is running. Open services.msc, locate CodeMeter Runtime Server, confirm Status = Running and Startup Type = Automatic. If stopped, right-click → Start.
  2. Verify ALM recognizes the USB stick. Launch ALM, expand the left tree under Connect Target System. The USB stick should appear as USB [xxxxxxxx] where xxxxxxxx is the 8-digit CmStick serial. If it is missing, the stick is defective or the CodeMeter driver is corrupt.
  3. Check the license containers on the stick. Right-click the stick → Check. A healthy container reports Status: OK. A damaged container reports Status: CRC error or Status: Firmware update required.
  4. Verify destination drive writability. Open an elevated Command Prompt and execute: echo test > D:\alm_write_test.txt && del D:\alm_write_test.txt

    If either command fails, the operating system is preventing the ALM service from writing. This is the most common cause of the reported error.

5. Step-by-Step Resolution Procedure

Execute the steps in order. Do not skip a step — each builds diagnostic evidence for the next.

Step 1 — Re-launch ALM as Administrator

Close the ALM GUI completely. Right-click the desktop shortcut or Start Menu → Siemens Automation License Manager → More → Run as administrator. Confirm the UAC dialog. The ALM service itself always runs as SYSTEM, but the GUI must be elevated on Windows 10/11 to perform Transfer and Export operations on system-wide stores.

Step 2 — Unlock the USB Stick

The red Siemens USB stick has a small sliding switch on the side. Slide it away from the contact pins. The physical lock is the only supported mechanism. If the switch is missing or damaged, the stick is permanently read-only and must be returned to Siemens for re-licensing via the Siemens Industry Online Support license generator portal.

Step 3 — Confirm the Destination Folder Exists and Is Writable

The default ALM local store is:

%ProgramData%\Siemens\Automation License Manager\Local\

Verify with:

if not exist "%ProgramData%\Siemens\Automation License Manager\Local" mkdir "%ProgramData%\Siemens\Automation License Manager\Local"

Grant write access:

icacls "%ProgramData%\Siemens\Automation License Manager\Local" /grant "BUILTIN\Users":(OI)(CI)M /T

Step 4 — Restart the CodeMeter Runtime

From an elevated Command Prompt:

net stop "CodeMeter Runtime Server" /y
net start "CodeMeter Runtime Server"

Wait 5 seconds, then verify the CmStick re-appears in ALM. If it does not, unplug and re-plug the stick. CodeMeter performs a hot-plug enumeration cycle on service start.

Step 5 — Retry the Transfer

In the ALM GUI:

  1. Right-click the USB stick in the source pane.
  2. Select Transfer License Key (or Transfer All License Keys if multiple).
  3. In the destination pane select Local.
  4. Click Transfer.
  5. Wait for the success dialog: License key successfully transferred.

If the error persists, capture the exact text of the Details string and the contents of %ProgramData%\Siemens\Automation License Manager\Log\ALM.log for the time window of the failed attempt.

6. USB Drive-Specific Diagnostics and Remediation

6.1 Verify the USB CmStick is Recognized as a CodeMeter Device

Open CodeMeter Control Center (installed alongside ALM). In the license container list, the stick should be displayed with its CmBox serial and marked as Container: CmStick (USB). If it appears as a generic removable disk in Windows Explorer but not in CodeMeter Control Center, the CodeMeter driver is missing. Reinstall from:

C:\Program Files (x86)\CodeMeter\Runtime\bin\CodeMeter.exe /i

6.2 USB Port and Power Considerations

CodeMeter sticks require a USB 2.0 or higher port with stable 5 V supply. Issues observed in the field:

  • Front-panel USB on desktop towers often lacks sufficient current → stick enumerates but ALM cannot read it.
  • USB hubs without external power intermittently drop the stick during the transfer, producing a partial write and the generic error.
  • USB 3.0 ports in some Dell/Lenovo docking stations report the stick as removable storage only.

Recommended: plug the stick directly into a rear I/O USB 2.0 port on the workstation motherboard.

6.3 Windows Write-Policy Registry Override

Windows applies a write protection policy when the user holds the stick's physical switch in the locked position. Verify the policy status:

reg query "HKLM\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies" /v WriteProtect

If WriteProtect REG_DWORD 0x1 is present, remove it:

reg delete "HKLM\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies" /v WriteProtect /f

Then eject and re-insert the stick.

7. Destination Drive (D:\) Permission and File System Checks

Even when the USB stick is healthy, the destination D:\ drive can refuse the ALM write operation. Apply the following verifications:

7.1 File System Compatibility

The ALM local store requires an NTFS-formatted volume with compression disabled on the target folder. FAT32 and exFAT volumes are not supported for the local license store. Verify with:

fsutil fsinfo volumeinfo D:

Look for FileSystemName = NTFS. If the value is anything else, the ALM service will refuse the write operation silently and report the generic error.

7.2 Disk Quota

If a disk quota is enforced on D:\, the user account may be over the limit. Check via This PC → D: Properties → Quota tab or with:

fsutil quota query D:

Set the quota to Unlimited or raise the limit for the engineering account.

7.3 Windows Defender Controlled Folder Access

Controlled Folder Access blocks write operations performed by untrusted processes. If the ALM service is not in the allow-list, it cannot write to protected folders (Documents, Desktop, etc.). Configure via:

  1. Open Windows Security → Virus & threat protection → Ransomware protection → Manage Controlled Folder Access.
  2. Click Allow an app through Controlled folder access.
  3. Add C:\Program Files (x86)\Siemens\Automation License Manager\almservice.exe.

8. ALM Service, Version, and Compatibility Verification

Siemens ships the ALM independently of TIA Portal and frequently issues updates. A version mismatch between the ALM and the TIA Portal can produce a transfer error even on a clean system.

TIA Portal Version Minimum Required ALM Version Recommended ALM
V13 / V13 SP1 ALM V5.3 ALM V5.3 SP3
V14 / V14 SP1 ALM V6.0 ALM V6.0 SP4
V15 / V15.1 ALM V6.0 ALM V6.0 SP6
V16 ALM V6.0 ALM V6.0 SP9
V17 ALM V6.0 ALM V6.0 SP11
V18 ALM V6.2 ALM V6.2 SP1
V19 ALM V6.3 ALM V6.3 SP1 or later
V20 ALM V6.4 ALM V6.4 (current as of 2024)

To check the installed ALM version: ALM → Help → About. The dialog displays the build number. Cross-reference with the Siemens Automation License Manager download index and update if necessary.

8.1 Complete ALM Repair Procedure

  1. Download the latest ALM from Siemens support (single self-extracting EXE).
  2. Close ALM and stop the ALM service: net stop "almservice" /y.
  3. Stop CodeMeter: net stop "CodeMeter Runtime Server" /y.
  4. Run the ALM installer as Administrator. Select Repair when prompted.
  5. Reboot the workstation.
  6. Re-launch ALM as Administrator and retry the transfer.

9. Advanced Troubleshooting: Registry, Logs, and Repair

9.1 Reading the ALM Trace Log

Enable verbose tracing before reproducing the failure:

  1. Open Registry Editor as Administrator.
  2. Navigate to HKLM\SOFTWARE\WOW6432Node\Siemens\Automation License Manager.
  3. Create a DWORD value named LogLevel with data 0x000000FF (maximum verbosity).
  4. Reproduce the transfer.
  5. Open the most recent ALM_YYYYMMDD.log in %ProgramData%\Siemens\Automation License Manager\Log\.
  6. Search for the substring ERROR or E_ACCESSDENIED. The log line typically identifies the exact API call that failed.

9.2 CodeMeter Log Location

CodeMeter writes its own log to:

%ProgramData%\CodeMeter\Logs\

Review the CodeMeter.log for the failed session. A healthy transfer shows a sequence of Bind, Read, Write, and Release events. An interrupted transfer shows Write followed by Release (timeout).

9.3 Removing Stale Licenses on the Destination

If a previous partial transfer left an orphan container, the new transfer may refuse to overwrite. Clean the local store:

  1. Stop the ALM service.
  2. Move all *.WibuCmRaU and *.CmBox files from %ProgramData%\Siemens\Automation License Manager\Local\ to a backup folder.
  3. Restart the ALM service.
  4. Retry the transfer.

10. Alternative Transfer Methods

When the GUI transfer continues to fail, two workarounds are available.

10.1 Command-Line Transfer via CodeMeter

CodeMeter ships a CLI utility at C:\Program Files (x86)\CodeMeter\Runtime\bin\cmu32.exe. It can perform a license transfer with explicit error reporting:

cmu32.exe --list

Identify the source CmStick serial, then run:

cmu32.exe --transfer --source 12345678 --destination local

The CLI returns one of:

  • Transfer successful
  • ERROR_CM_SOURCE_NOT_FOUND → stick not enumerated
  • ERROR_CM_DESTINATION_READONLY → destination media issue (this is the most common output that matches the GUI error)
  • ERROR_CM_LICENSE_IN_USE → license is checked out by another process

10.2 License Server (Network Floating License)

For engineering teams with multiple workstations, Siemens offers the ALM License Server option. The license is bound to a single USB stick on a dedicated server, and TIA Portal clients check out the license over TCP/UDP port 22350 and 22351. This eliminates the need to transfer the license to a local drive entirely. See the Siemens License Server Installation Guide.

10.3 Virtual Machine Considerations

If the engineering workstation is a VM, ensure the USB stick is mapped in pass-through mode to the VM. VMware Tools and Hyper-V Integration Services can present the stick as a removable disk to the guest but fail to forward the CodeMeter USB device descriptor. The fix is to enable USB Controller → Show all USB input devices in VMware and explicitly route the CodeMeter USB device.

11. Verification and Validation

After a successful transfer, perform the following four checks to confirm the license is operational:

  1. ALM tree view: The license appears under Local → [Computer Name] with a green check icon.
  2. Status check: Right-click the local license → Check. Status must report OK.
  3. TIA Portal start-up: Launch TIA Portal. The splash screen should not display License missing. Open a project that uses the licensed option (e.g., S7-1500 with F-CPU). The editor must allow save operations without prompting for a license.
  4. Trial period verification: In TIA Portal, navigate to Help → License Analysis. The licensed option must show Remaining time: Unlimited and Type: Complete.
Backup recommendation: Once transferred, back up the local license container files (*.WibuCmRaU, *.CmBox) to a secure, encrypted location. Losing a license requires a re-issue from Siemens, which can take 2-10 business days.

12. Preventive Measures and Best Practices

  • Always run the ALM GUI as Administrator on Windows 10/11.
  • Apply Windows and ALM updates on a defined schedule (recommended: monthly).
  • Keep the USB stick inserted in a stable, rear-panel USB port. Avoid front-panel and hub connections.
  • Document the destination path of the local license store in the engineering station commissioning record.
  • Configure Group Policy or EDR allow-listing for almservice.exe and CodeMeter.exe before deploying TIA Portal to new workstations.
  • Maintain a license matrix spreadsheet mapping TIA Portal version, ALM version, and required license option codes (e.g., 6AV2.100-1AA00-0AA0 for TIA Portal V18 Basic).
  • For new projects, use a network license server to remove single-point-of-failure USB sticks.

FAQ

What does "Cannot write to the data medium in drive E:" mean in the ALM error details?

The detail string indicates that the ALM service attempted to write a license container to the drive letter shown (commonly E: for the USB stick, or D: for the local hard drive), but Windows returned a write failure. The most frequent cause is a write-protected USB stick, an NTFS permission issue on the destination folder, or the CodeMeter Runtime service being stopped.

How do I unlock a write-protected Siemens red USB license stick?

The red Siemens license stick (CmStick/S) has a small physical slider on the side. Slide it away from the USB contact pins to unlock. If the slider is missing or broken, the stick is permanently read-only and must be returned to Siemens for re-licensing through the license generator portal. There is no software command to override the hardware write-protect state.

Which ALM version is required for TIA Portal V18 and V19?

TIA Portal V18 requires ALM V6.2 SP1 or later, and V19 requires ALM V6.3 SP1 or later. The current ALM V6.4 supports all TIA Portal versions back to V16. The installed ALM version is displayed in ALM → Help → About, and updates are available from the Siemens Industry Online Support download portal.

Can I transfer a license from the USB stick to a network share instead of a local drive?

No. The ALM local store must reside on a fixed local NTFS volume. The supported options are the local hard drive (typically D:\) or a CodeMeter network license server. Mapping a network share as the local store is not supported and will produce the "Cannot write to the data medium" error.

What registry key controls the ALM log verbosity?

The DWORD value LogLevel under HKLM\SOFTWARE\WOW6432Node\Siemens\Automation License Manager controls verbosity. Set it to 0x000000FF for maximum detail, reproduce the failure, and review the log file in %ProgramData%\Siemens\Automation License Manager\Log\. The log will identify the specific API call that triggered the write failure.

Does antivirus software block the ALM license transfer?

Yes. Endpoint Detection and Response (EDR) products such as CrowdStrike, Microsoft Defender for Endpoint, and SentinelOne can quarantine almservice.exe or block writes to %ProgramData%\Siemens\Automation License Manager\Local\. Add the ALM installation folder and the local license store to the AV exclusion list to prevent this.

Can the license transfer fail silently without showing the "None or not all license keys transferred" dialog?

No. The ALM GUI always displays a transfer result dialog. If the dialog closes immediately or the GUI crashes during the transfer, the issue is typically a corrupted CodeMeter container or a stalled CodeMeter service. Restart the CodeMeter Runtime service, then re-launch the ALM as Administrator and retry.

Back to blog