vbscript - Defining a save path in VB -
the script creates txt file of info users pc saves shared directory folder f:\installedsoftware\
if writefile(s, sfilename) 'optional prompt display if msgbox("finished processing. results saved " & sfilename & _ vbcrlf & vbcrlf & "do want view results now?", _ 4 + 32, stitle) = 6 wscript.createobject("wscript.shell").run """" & sfilename & """", 9 end if end if
a) sfilename = "f:\installedsoftware\" & scompname & "_" & getdtfilename() & "_software.txt"
b) sfilename = scompname & "_" & getdtfilename() & "_software.txt"
both result in file being created e.g “ johnpc_05112011_093842_software.txt”
but b correctly creates in current active directory.
two problems, have shared drive, if email link vb script, have use exhibit exhibit b uses current active directory. second problem f: drive mapped on machines different drive letter j or k or in virtual environments different drive. exhibit b work long in correct folder.
is there different way of designating path. i.e
ip address or dns name not use drive letter?
sfilename = "????????????????\installedsoftware\" & scompname & "…………..
simply use unc path of location drive mapped to;
sfilename = "\\server_name_or_ip\optional_path\installedsoftware\" & scompname & ..."
Comments
Post a Comment