Forum Discussion

msilva's avatar
msilva
Occasional Contributor
14 years ago

AqFile object and Windows env. variables.

Hi!

Im trying to write a script that must run on several machines (dif. language, and dif. users).

I decided to make a generic one using the windows enviroment variables to verify the existence of some files, but as far I try I cant make my script do what it need to do.

Just an example:



Jscript



function Test() 



  var sPath; 

  sPath = "%HOMEDRIVE%\\MyFile.txt"; 





  if (!aqFile.Exists(sPath))  

    aqFile.Create(sPath); 

  aqFile.WriteToTextFile(sPath, "Hello, world!" + "\r\n", aqFile.ctANSI, false); 



Any ideas?

Thanks