The naming part isn't working either though. It was hard coded to a given name 
in the original script. I made it get the user name and it's naming the file 
just the user name without and extension. I've tried various combinations of 
the userName variable and the extention with no luck.

Dim objNetwork
Dim userName
 
Set objNetwork = CreateObject("WScript.Network")
userName = objNetwork.UserName

Set oGpm = CreateObject("GPMGMT.GPM") 
Set oGpConst = oGpm.GetConstants() 

Set oRSOP = oGpm.GetRSOP( oGpConst.RSOPModeLogging, "" , 0) 
strpath = "\\myservername\sharename"

oRSOP.LoggingFlags = 0 

oRSOP.CreateQueryResults() 
Set oResult = oRSOP.GenerateReportToFile (oGpConst.ReportHTML, strPath & 
userName)
oRSOP.ReleaseQueryResults() 

WScript.Echo "Complete"

WScript.Quit()


From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On 
Behalf Of slkissin...@sbcglobal.net
Sent: Monday, July 21, 2014 1:37 PM
To: scripting@lists.myitforum.com
Subject: Re: [scripting] VBScript Write file to Network path

strPath = “\\Myserver\MyShare\<file:///\\Myserver\MyShare\>”

instead of what strpath= now

From: Marcum, John<mailto:jmar...@babc.com>
Sent: ‎Monday‎, ‎July‎ ‎21‎, ‎2014 ‎1‎:‎27‎ ‎PM
To: scripting@lists.myitforum.com<mailto:scripting@lists.myITforum.com>

What would I need to change in order for this script to a the file named 
userName.html to the path \\myserver\myshare<file:///\\myserver\myshare>?



Dim objNetwork
Dim userName
 
Set objNetwork = CreateObject("WScript.Network")
userName = objNetwork.UserName

Set oGpm = CreateObject("GPMGMT.GPM") 
Set oGpConst = oGpm.GetConstants() 

Set oRSOP = oGpm.GetRSOP( oGpConst.RSOPModeLogging, "" , 0) 
strpath = Left(Wscript.ScriptFullName, InStrRev(Wscript.ScriptFullName,"\", -1, 
vbTextCompare) ) 

oRSOP.LoggingFlags = 0 

oRSOP.CreateQueryResults() 
Set oResult = oRSOP.GenerateReportToFile (oGpConst.ReportHTML, strPath & 
userName)
oRSOP.ReleaseQueryResults() 

WScript.Echo "Complete"

WScript.Quit()


________________________________
        John Marcum
            MCITP, MCTS, MCSA
              Desktop Architect
   Bradley Arant Boult Cummings LLP
________________________________
      [H_Logo]


________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.

________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.

________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.

Reply via email to