Link to home
Start Free TrialLog in
Avatar of wilko1000
wilko1000

asked on

VB Script save a file in a specifed location as xml

Hi

I have a script that saves a file as XML but having a problem saving it to my specified location.

Sample code:
' My specified save location
strSavePath = "C:\Test\CWTest"

' File save to location
'------------------------------------------------------------------------  
   strFileName =  strSavePath & Left(oFile.Name,Len(oFile.Name)-3) & "xml"  
   Set File = FSO.createTextFile(strFileName, True)
   File.Write strXML
   File.Close

The file does save fine as an xml file but it keeps dumping into the test folder (next folder up) when i want to dump it into the CWTest folder

How can i amend it to save to 'CWTest' folder rather than the 'Test' folder
ASKER CERTIFIED SOLUTION
Avatar of Saurabh Singh Teotia
Saurabh Singh Teotia
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wilko1000
wilko1000

ASKER

Ah the backslash was missing, both solutions worked. (Saurabh) was the simplest but in fairness both soultions worked

Thanks you