Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run command works When IT wants to...

Status
Not open for further replies.

stanlyn

Programmer
Sep 3, 2003
945
US
Hi,

Using VFP9sp2 on Win8 and on the same desktop session as an administrator, I'm getting varied results using the run command.

gcFileName = 'e:\folder\sub folder\another folder\100\1.tif'

Run /N2 Attrib -r &gcFileName - worked when testing when I created it, and now it doesn't change the attribute, and it does not error.

Just now I tested these three iterations, and it still will not change the attribute.
Run /N2 Attrib -r '"' + (gcFileName) + '"'
or
Run /N2 Attrib -r '"' + &gcFileName + '"'
or
Run /N2 Attrib -r (gcFileName)

If I use the OS's command window, it works as expected by typing...
Attrib -r "e:\folder\sub folder\another folder\100\1.tif"

I haven't closed the session yet because I'm keeping its current state in the debugger open while testing for a fix.

The file is not open as I can delete it with Windows explorer, then add it back and set its attribute to RA, and when setting the "set next line to" in the debugger to it and execute it again, it still fails...

What can I do to test and fix this?

Thanks,
Stanley
 
It's wrong you can't trust RUN, you have to use it right and know how to configute it with FoxRun.pif or %COMSPEC% and it runs as expected. By the way, using wscript shell without quotation marks again will be problematic for files and paths including spaces.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top