Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Browse hidden share on remote PC

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Browse hidden share on remote PC
  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 >>
 Browse hidden share on remote PC - 10/4/2006 12:17:08 AM   
  takeda kozo

 

Posts: 82
Score: 0
Joined: 11/9/2005
Status: offline
Is there a way to open up a new windows explorer (explorer.exe) window ..... whose default view is set to the hidden share (c$) on a remote PC ?

I am trying to do this Via a button on a HTA

From my understanding, I can use the network object to Map a network drive (but again, unsure how to damn well do this with alternate credentials)

Hrrrrmmm.......

Anyway tried to do this before ?


SIDE NOTE: I am REALLY getting sick of this dodgy alternate credentials stuff in VBscript.

 
 
Post #: 1
 
 RE: Browse hidden share on remote PC - 10/4/2006 12:58:19 AM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
to map a network drive with alternate credentials

set WshShell = CREATEOBJECT("WScript.Shell")
WshShell.Run("net use z: \\server\share /user:domain\username password")

for information on how to Open the explorer window to the drive take a look here
http://www.microsoft.com/technet/scriptcenter/resources/qanda/mar06/hey0317.mspx

< Message edited by gdewrance -- 10/4/2006 1:02:07 AM >

(in reply to takeda kozo)
 
 
Post #: 2
 
 RE: Browse hidden share on remote PC - 10/4/2006 4:24:55 AM   
  ginolard


Posts: 1051
Score: 21
Joined: 8/10/2005
Status: offline
Or, alternatively,

set WshShell = CREATEOBJECT("WScript.Shell")
strComputer="XXX"

WshShell .Run("explorer.exe \\" & strComputer & "\C$")

Little known Windows tip:  Explorer.exe accepts a command line value ;)

_____________________________

Author of ManagePC - http://managepc.net
AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm
Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm

(in reply to gdewrance)
 
 
Post #: 3
 
 RE: Browse hidden share on remote PC - 10/4/2006 4:42:15 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
quote:

SIDE NOTE: I am REALLY getting sick of this dodgy alternate credentials stuff in VBscript.


FYI, VBScript is there to administer the PC, therefore Admin priviliges is preferred.



You can't say: Sick of getting a ticket for not having a drivers license, but still want to drive


_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to takeda kozo)
 
 
Post #: 4
 
 RE: Browse hidden share on remote PC - 10/4/2006 7:10:54 AM   
  mcds99


Posts: 433
Score: 4
Joined: 2/28/2006
Status: online
What many companies do is create a Global group, put it in the Local Administrators group of each PC.

Add a person to that group, have that person logoff/on.

This Global group needs to be watched carefully.



_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to takeda kozo)
 
 
Post #: 5
 
 RE: Browse hidden share on remote PC - 10/4/2006 11:40:32 AM   
  takeda kozo

 

Posts: 82
Score: 0
Joined: 11/9/2005
Status: offline
quote:

ORIGINAL: Snipah

FYI, VBScript is there to administer the PC, therefore Admin priviliges is preferred.


You can't say: Sick of getting a ticket for not having a drivers license, but still want to drive




In a perfect world, that would be nice. But when you work in a global organization with a massive IT infrastructure, you cant go giving admin rights to every tom dick and harry

Nice analogy, but doesn't really apply. I was trying to make the point that VBscript is used to administer REMOTE PC's (as well as local)... therefore, there should be some more objects available within the script to help with connecting under different accounts. Having to use things such as "runas.exe" etc just feels so backward ........




(in reply to Snipah)
 
 
Post #: 6
 
 RE: Browse hidden share on remote PC - 10/4/2006 5:16:22 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
Nice ginolard. How can we add Username & Password to that

(in reply to ginolard)
 
 
Post #: 7
 
 RE: Browse hidden share on remote PC - 10/4/2006 5:47:29 PM   
  takeda kozo

 

Posts: 82
Score: 0
Joined: 11/9/2005
Status: offline
quote:

ORIGINAL: gdewrance

Nice ginolard. How can we add Username & Password to that



Here's what I did:

'===============================

Sub Authenticate

Machine = "XXX"
strAdminUser = "YYY"
strAdminPass = "ZZZ"

ReturnCode = oShell.Run("net use \\" & Machine & "\c$ " & strAdminPass & " /user:" & strAdminUser,,True)

  If ReturnCode = 2 Then
     Remote_Access_Granted = 0
  ElseIf ReturnCode = 0 Then
     Remote_Access_Granted = 1
     Last_Connected_Machine = Machine
  End If

If Remote_Access_Granted = 1

   strConnect_Explorer = "oShell.Run(""c:\windows\explorer.exe \\" & Machine & "\c$"")" 
   Execute(strConnect_Explorer)

End If

End Sub

(in reply to gdewrance)
 
 
Post #: 8
 
 RE: Browse hidden share on remote PC - 10/4/2006 11:06:42 PM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
If MS didn't have the security set the way they did with Vbscript, then we would see many more viri like the ILoveYou virus.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to takeda kozo)
 
 
Post #: 9
 
 RE: Browse hidden share on remote PC - 10/5/2006 1:01:16 AM   
  takeda kozo

 

Posts: 82
Score: 0
Joined: 11/9/2005
Status: offline
If anyone's curious why I posted subs.....then it was because I pulled this code from a HTA i've been working on

(in reply to mbouchard)
 
 
Post #: 10
 
 
 
  

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 >> Browse hidden share on remote PC 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