Focal Point
[SOLVED] Net Use with Spaces

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9627007686

June 12, 2017, 05:03 PM
rogerwilkouk
[SOLVED] Net Use with Spaces
Has anyone managed to get the net use command to work when the file path has spaces in it.
I have tried with single quotes around the entire path, double quotes around the entire path and it just won't seem to work.
The path location I need to save the file to is below and if I remove the space and replace it with an underscore it works so it definitely seems to be the space causing the problem.
CMD net use J: \\TGMO1\CORP_IS\MOIBI\TEST 1

This message has been edited. Last edited by: FP Mod Chuck,


WF 81.5, Windows7
AS/400 Database.
All Outputs

June 12, 2017, 06:44 PM
Waz
Have you tried wrapping the path in quotes ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 13, 2017, 11:09 AM
Emily Max
You can try putting the file path in a variable, and then using the .QUOTEDSTRING sufix. For example:
  
-SET &filepath = '\\TGMO1\CORP_IS\MOIBI\TEST 1';

CMD net use &filepath.QUOTEDSTRING  


Hope that helps.

-Emily


WF 8.1.05 on Windows machines
Backend: Informix, SQL and Oracle databases
June 13, 2017, 02:14 PM
dhagen
There is always an alternate physical name for any directory with a space in it. Issue the following from the parent directory so see it:
dir *. /x  


You can use the alternate name (like: TEST1~1)


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
June 13, 2017, 05:40 PM
Waz
quote:
alternate physical name


That's the old dos 8.3 name.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 14, 2017, 12:05 PM
rogerwilkouk
I tried wrapping the path in quotes and I tried Emily's idea of putting it into a Variable first and using QUOTEDSTRING but unfortunately neither works.
I think I might have to use a different directory to put it in and then try and call a batch file/external procedure to move it.


WF 81.5, Windows7
AS/400 Database.
All Outputs

June 14, 2017, 05:39 PM
Waz
Can you post the code, I've done this before and its worked.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 15, 2017, 08:44 AM
rogerwilkouk
Waz,

You are right. It worked with the quotes around it. I had a permissions issue going on.

Thanks


WF 81.5, Windows7
AS/400 Database.
All Outputs