Metaborn Posted October 4, 2007 Share Posted October 4, 2007 I always forget \\HOSTNAME/c$ when I need to use it.Plus I was boredCODE#cs ---------------------------------------------------------------------------- Author: Joshua McTyre Version: 1.0.0 Date: 10/03/07 AutoIt Version: 3.2.6.0 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 ----------------------------------------------------------------------------#NoTrayIconOpt("RunErrorsFatal", 1)Opt("MustDeclareVars", 1)main()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 EndIf ;;; 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) EndIf ConsoleWrite($cmd & @CRLF)EndFunc Link to comment Share on other sites More sharing options...
jvanegmond Posted October 4, 2007 Share Posted October 4, 2007 Why would you use Administrative Shares? github.com/jvanegmond Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now