Results 1 to 4 of 4
OK, my question will probably be easy but i have no clue where to start with this. I have a logon script set in the startup folder "All Users > ...
- 09-05-2010 #1Just Joined!
- Join Date
- Sep 2010
- Posts
- 5
Windows Equivelant - Logon Batch Scripts
OK, my question will probably be easy but i have no clue where to start with this. I have a logon script set in the startup folder "All Users > Startup > logon.bat" and it nicely mounts network drives from a Windows Server 2003 computer. The script is as follows:
<logon.txt (.bat) attachment>
Very simple. Now what I need to know:
- What is a batch equivalent and what commands will I need?
- Where is/how do I use the equivalent to Startup folder
- Can I get it to mount in the Computer folder or will it be mounted through root ("/") or can I have it easily accessible (maybe the Desktop)?
- Is there a way I can get the equivalent to the Windows password vault (remember passwords for certain addresses) and;
- If not, can I get the script to request Username and Password from the user for the mapping?
- Can I write to the folders if the user has permissions to write (had trouble with smbmount doing this)
Thanks for your help,
Another newbie
- 09-05-2010 #2
There are many ways to accomplish this. You could put it into /etc/fstab and it will be mounted at boot before users log in. You could mount it also from rc.local. You could mount it from user login files like bashrc, you could have it even mounted from DE startup files, either system or user. You are free to choose any mount point you like, be it in /media or users home or users desktop.
As you can see, for Linux beginners the choice is overwhelming.
- 09-07-2010 #3Just Joined!
- Join Date
- Sep 2010
- Posts
- 5
- 09-07-2010 #4
In /etc/fstab it will be just one line, no script needed. See man fstab and man mount for syntax.
Generally, script is just a file with a command in it. Example contents of myscript below.
This file can have the executable bit set to be executed by shell. See man chmod. Following command will run it:Code:/path/to/mycommand
If it does not have the executable bit set you can still execute it like this:Code:myscript
Bash is just an example, use the shell you want.Code:bash myscript
If you do not want to run it in your current session but want open another instead you can add shebang:
Well, all this and much more is explained in Advanced Bash-Scripting Guide.Code:#!/bin/bash [options] /path/to/mycommand


Reply With Quote
