Jump to content
Sign in to follow this  


Recommended Posts

I always forget \\HOSTNAME/c$ when I need to use it.

Plus I was bored


#cs ----------------------------------------------------------------------------

Author: Joshua McTyre

Version: 1.0.0

Date: 10/03/07

AutoIt Version:

License: http://www.gnu.org/copyleft/gpl.html

Script Function: To open root on a remote system

I always forget how to open C:/ on a remote machine,

aka run this: \\HOSTNAME/c$

So I made this.

#ce ----------------------------------------------------------------------------


Opt("RunErrorsFatal", 1)

Opt("MustDeclareVars", 1)


Func main()

Local $hostname

Local $cmd

Local $result

Local $msg

;;; Prompt for Hostname

$msg = "To open C:/ on a remote machine " & @CRLF & "enter its hostname or IP Address." & @CRLF & @CRLF & "Leave it blank to open yours."

$hostname = InputBox("Prompt for Hostname", $msg)

;;; If the user enters no hostname, then use localhost

If $hostname == "" Then

$hostname = @ComputerName


;;; Running $cmd

$cmd = "Start " & "\\" & $hostname & "/c$"

$result = RunWait(@ComSpec & " /c " & $cmd, "", @SW_HIDE)

;Success: Returns the exit code of the program that was run. Success == 0

If $result <> 0 Then

ConsoleWriteError("Error: RunWait() returned a bad exit code: " & $result & @CRLF)


ConsoleWrite($cmd & @CRLF)


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...