Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Outputting to MsgBox

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,60277
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Outputting to MsgBox
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Outputting to MsgBox - 5/15/2008 7:57:53 PM   
  ninjamaster

 

Posts: 107
Score: 0
Joined: 1/23/2007
Status: offline
Hi folks

I am writing (infact completed apart from this one part that I would like to add but not essential!) a script to create a users home drive on a network server and change the permissions on the folder.

Now all that works fine except I am wanting to echo back on screen what the settings are on the folder after they have been changed to prove they are set.

I have used CACLS to change the permissions and I know that I can run CALCS again againsts the folder to list the current permissions. But how do I return the results from shell back to a MsgBox or similar.

I know I could write to a text file then pump that into a box but was wondering (hoping) there was a way to have it put straight in.

so far I have tried

'echo folder permissions back to screen
strPerm = objShell.run "CACLS " & strPath                  <- BUT IT DOESN'T LIKE THIS LINE
wscript.echo strPerm

and

'echo folder permissions back to screen
strPerm = "CACLS" & strPath
wscript.echo                                                                  <- WHICH OBVIOUSLY ECHOs "CACLS \\Server\folder" to screen :)

Any pointers please?

Many thanks


 
 
Post #: 1
 
 RE: Outputting to MsgBox - 5/16/2008 12:39:40 AM   
  dm_4ever


Posts: 2664
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Look at the Exec Method of WSHShell instead of the Run Method.

http://msdn.microsoft.com/en-us/library/ateytk4a(VS.85).aspx

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ninjamaster)
 
 
Post #: 2
 
 RE: Outputting to MsgBox - 5/19/2008 8:40:14 PM   
  ninjamaster

 

Posts: 107
Score: 0
Joined: 1/23/2007
Status: offline
excellent thanks! Does the job. Here's the function I've created :)


      

(in reply to dm_4ever)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Outputting to MsgBox Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts