From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy a file to %TEMP%?

Solved!
Go to solution

@MaSta wrote:

@Hooovahh, a counter thesis: LabVIEW uses a Windows system DLL to do the actual copy action and will pass the given path to it. The system DLL should be able to cope with %TEMP%, wouldn't you agree? 


"counter thesis"? Hooovahh explanation is correct. LV works on more than just one OS.

The "actual copy action" is always a system level command. Be it on Linux or Windows.

If you are restricting yourself to Windows, then Wiebe has the best answer... which I am now placing into my toolbox 👍

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 11 of 14
(428 Views)

I read Hooovahh's post as " LabVIEW cannot cope with %TEMP% variable because it's multiplatform" and not as "you shouldn't use %TEMP% in LabVIEW because it might restrict you". That's why my counter thesis that it actually should be able to work with %TEMP%. 

0 Kudos
Message 12 of 14
(412 Views)

"Reading between the lines" is not required in this instance.

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 13 of 14
(395 Views)

@MaSta wrote:

@Hooovahh, a counter thesis: LabVIEW uses a Windows system DLL to do the actual copy action and will pass the given path to it. The system DLL should be able to cope with %TEMP%, wouldn't you agree? 


You are right that LabVIEW uses the Win32 API. But you are wrong that Windows knows on this level about environment variables. This is a feature of the Windows Shell (shell32.dll respective the Windows command prompt). Both of these use also the Win32 API underneath (and sometimes directly the Windows NT kernel API which lies under the Win32 API and should for all practical purposes still be considered undocumented).  The Windows kernel does not know about environment variables and not even about the registry. The Win32 API is nowadays a "fairly" thin layer around the Windows kernel API to maintain backward compatibility with the original Win3.1 API. But that didn't know environment variables either. That was a feature of the underlaying DOS, which was used to launch the DOS extender on which the Windows 3.1 GUI was then run. 

Rolf Kalbermatter
My Blog
Message 14 of 14
(388 Views)