Re: Using local host & current user in file name

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Set net = WScript.CreateObject("WScript.Network")
userName = net.Username
hostname = net.Computername
"Philippe l. Balmanno" <plb2862@xxxxxxx> wrote in message news:uE27h63QFHA.2736@xxxxxxxxxxxxxxxxxxxx...
I ' am trying to save the results of a script in an Excel workbook.  I would like to use the local host and current user name and the date.  the results will be used to compare changes 9installed software).  However, I don't know how to grab the info for the host and user and insert it in the file name.  I would appreciate any help, TIA  
 
This is what I have so far:
 
dtmThisDay = Day(Date)
dtmThisMonth = Month(Date)
dtmThisYear = Year(Date)
??? = ???     'or other method
 
strBackupName = "c:\Scripts\" & ??? & " " & dtmThisYear & "-" & dtmThisMonth & "-" & _
   dtmThisDay & ".xls"
 
objExcel.ActiveWorkbook.SaveAs strBackupName
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit

--
Philippe L. Balmanno

 

GIF image



Relevant Pages

  • Re: ASPUpload / Email question
    ... ever tried html basics ... I ' am trying to save the results of a script in an Excel workbook. ... I would like to use the local host and current user name and the date. ...
    (microsoft.public.scripting.vbscript)
  • Using local host & current user in file name
    ... I ' am trying to save the results of a script in an Excel workbook. ... I would like to use the local host and current user name and the date. ... TIA ...
    (microsoft.public.scripting.vbscript)
  • Re: FreeBSD 7.0-RELEASE Available
    ... Posting come & go & forgotten, so I suggest send your final script ... copied in advanced to local host) people can have available ... Mail just Ascii plain text. ...
    (freebsd-stable)