LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Choose file to write" pop up on XP

So I've got a functioning VI that works just fine in Windows 7. However when I created an installer and installed it onto a target XP PC I get a "Choose file to write" pop up during execution - something I didn't get in Windows 7. I've attached the VI. Any ideas?

 

EDIT: The pop-up comes after the while loop.

0 Kudos
Message 1 of 8
(4,154 Views)

I suspect that Windows XP might not recognize your Path, which you have specified as "%userprofile%\desktop".  I'm trying to fire up an XP machine now to test this out ...

 

Bob Schor

0 Kudos
Message 2 of 8
(4,135 Views)

Nope, it may be more subtle than that.  There is a %USERPROFILE% in Windows XP (I don't think capitalization matters).  I tried (from a command prompt) the command -- dir %userprofile% -- and got an error message.  Then I recall that the User Profiles in XP are stored in the folder Documents and Settings, while in Windows 7, they are in Users.  So I tried -- dir "%userprofile%" -- and it worked.

 

Not sure why embedded spaces matter for the File Dialog function, but if it is calling on Windows, it might make a difference ...

 

Do let us know if this fixes your problem!

 

Bob Schor

0 Kudos
Message 3 of 8
(4,127 Views)

^I just tried that command in a run window and it worked. Also, the first dialogue I get in the VI points to the default directory of desktop successfully. So I think it's reading the path fine.

 

EDIT: I just saw your second response, I will get back to you.

0 Kudos
Message 4 of 8
(4,122 Views)

Unfortunately adding the quatation marks did not work. I feel like it's picking up the path fine, but somewhere after the loop it's messing up. As expected, everything is working in Windows 7.

0 Kudos
Message 5 of 8
(4,097 Views)

I'm pretty sure the problem is with this part of the code (see attachment). I've added indicators for the paths and they seem to be fine. But for whatever reasons it works in 7, but not in XP. Is it possible that XP doesn't like the filename I'm using? Here is an example of one: "pressure_data_2015-06-11 2 40 46 PM.txt"

0 Kudos
Message 6 of 8
(4,076 Views)

I don't know of a reason that name would be "bad", but I suppose anything iis possible.  Something you might try is to simply create the name "Test.txt", no spaces, in your code and see what that does.  Do you know about the Diagram Disable structure (on the Structure palette)?  You can drag a box around the code that creates the file name, it will "grey out" (Disabled), and you can put "Test.txt" in the Enabled side.  To undo, be sure the original code is "visible" and choose "Remove Diagram Disable" (right-click the diagram first ...).

 

BS

0 Kudos
Message 7 of 8
(4,046 Views)

Fixed it! Turns out using the Date String block with "%c" on Windows 7 uses "-", but on XP (for whatever reason) it uses "/". And of course the "/" character isn't allowed in a filename, hence the pop up. I just replaced the character with a "-".

0 Kudos
Message 8 of 8
(4,007 Views)