Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Run a remote script without mounting its drive first

Run a remote script without mounting its drive first
Thread Tools
opus_az
Junior Member
Join Date: Dec 2006
Status: Offline
Reply With Quote
Nov 30, 2007, 10:33 AM
 
Hi... For my Windows clients I can have a script something like
start \\ip.address\sharename\scriptname
In other words run a script that's saved on another computer but without needing to map a drive to that computer first.

How can I do the same thing in Tiger and Leopard? The script will be on a Windows machine, if that matters.

I'm still a novice when it comes to OS X networking and Linux commands. Hopefully I'm not missing something obvious.
     
Big Mac
Clinically Insane
Join Date: Oct 2000
Location: Los Angeles
Status: Offline
Reply With Quote
Nov 30, 2007, 10:53 AM
 
Sounds like a nice security risk.

"The natural progress of things is for liberty to yield and government to gain ground." TJ
     
opus_az  (op)
Junior Member
Join Date: Dec 2006
Status: Offline
Reply With Quote
Nov 30, 2007, 11:15 AM
 
In my case, no. The scripts are just the Windows NETLOGON scripts so there's inherent authentication involved.

Any suggestions?
     
analogika
Posting Junkie
Join Date: Feb 2005
Location: 888500128
Status: Offline
Reply With Quote
Nov 30, 2007, 01:18 PM
 
In Tiger, just create an alias to the file you want to open. Double-clicking it will automagically mount the drive and open the file.

For some reason, this has not worked in Leopard for me so far.
     
opus_az  (op)
Junior Member
Join Date: Dec 2006
Status: Offline
Reply With Quote
Nov 30, 2007, 04:33 PM
 
Originally Posted by analogika View Post
In Tiger, just create an alias to the file you want to open. Double-clicking it will automagically mount the drive and open the file.
For some reason this results in the user still getting a NETLOGON drive which is what I was trying to avoid. I was hoping for a one liner, but I'll keep experimenting. Shame about Leopard.

Thanks!
     
Thinine
Mac Elite
Join Date: Jul 2002
Status: Offline
Reply With Quote
Nov 30, 2007, 04:56 PM
 
Just unmount the share right after running the script.

What scripts are you running, since I can't see you running Windows NETLOGON scripts on a Mac.
     
olePigeon
Clinically Insane
Join Date: Dec 1999
Status: Offline
Reply With Quote
Nov 30, 2007, 05:28 PM
 
You could write a shell script that'll SSH to another computer and open the file that way.
"…I contend that we are both atheists. I just believe in one fewer god than
you do. When you understand why you dismiss all the other possible gods,
you will understand why I dismiss yours." - Stephen F. Roberts
     
opus_az  (op)
Junior Member
Join Date: Dec 2006
Status: Offline
Reply With Quote
Nov 30, 2007, 07:29 PM
 
Originally Posted by Thinine View Post
Just unmount the share right after running the script.

What scripts are you running, since I can't see you running Windows NETLOGON scripts on a Mac.
I'll try that. I won't have access to a Tiger machine until tomorrow, just Leopards today.

I keep all my logon scripts, OS X and Windows in the NETLOGON directory just for consistency sake. My OS X scripts are basically just a series of mount volume commands. There's a bit more to them but that's the jist.

I prefer having the scripts on the server so when I need to change them I don't have to ask the user to download another file. They can just have a shortcut that points to whatever script they need.

Originally Posted by olePigeon View Post
You could write a shell script that'll SSH to another computer and open the file that way.
I'll give that a go, wouldn't know where to start, novice and all.

On a side note, with Leopard, if I connect to at least on shared drive on my Windows server, I don't see the drive(s) listed in the Finder's Shared section but instead see the Servername and opening that shows all the drives I have permissions to not just ones I manually connected to. I actually like that better since it'd simplify my scripting, but I'm sure there's others who would not like it.
( Last edited by opus_az; Nov 30, 2007 at 07:46 PM. )
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 30, 2007, 09:03 PM
 
Install OpenSSH on Windows, setup public key authentication, invoke remote script via an SSH command from your Mac.

Read up on SSH, it is your friend.
     
opus_az  (op)
Junior Member
Join Date: Dec 2006
Status: Offline
Reply With Quote
Nov 30, 2007, 09:34 PM
 
Originally Posted by besson3c View Post
Read up on SSH, it is your friend.
Guess it's time. It's been on the fringe of a few projects, so yeah, guess I'll start cracking that nut.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 30, 2007, 10:24 PM
 
Here is my favorite SSH tutorial:

SSH Tutorial

Ultimately you'll be able to simply enter:

ssh [email protected] <remotecommand>

The only thing I'm unsure of is how the Windows version of openSSH will translate Unix commands into DOS commands, or whether it will at all. In your case, I imagine it would just be a question of changing slashes to back slashes or something though, but I know very little about the inner workings of Windows.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 06:37 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,