Jump to content

Recommended Posts

Posted

what do i do to allow a computer to run a script like ipconfig /release on startup.

I have assess to batch files and then from there to cmd and i want to run the script ipconfig /release everytime one of the computers start.

I know im a newb and please don't say crap im experimenting.

The computers are windows based machines

Posted

Create a new short cut to cmd, put it in the startup directory in the "All Programs" menu via the start button, then edit the shortcut path so it says:

"%windir%system32cmd.exe" /C ipconfig release

It's that simple :P

Posted
<grumpy old man>

back in my day we had a little file called autoexec.bat, and it spoke with config.sys... and we liked!

</grumpy old man>

Go back to the kitchen and check your blood pressure grandpa.

Posted
<grumpy old man>

back in my day we had a little file called autoexec.bat, and it spoke with config.sys... and we liked!

</grumpy old man>

Go back to the kitchen and check your blood pressure grandpa.

Burrrrrrn. Haha but I like the grumpy old man tags Darren. Nice touch. :P

Posted

This brings me onto a question I've been wondering about, probably worthy of its own topic but... meh.

Is there a Linux 'autoexec.bat' kinda script somewhere? I got a lot of commands I'd like to pass at boot

Posted

If you're using the very oldskool init scripts, there's an rc.local somewhere under /etc

On more current systems, you'd create a script that does something interesting in the init.d dir that's somewhere under /etc (/etc/rc.d/init.d or /etc/init.d typically). The script will be called with either 'start' or 'stop' as parameter on startup. Check some of the scripts already present to see how they deal with this. Once your script does what needs to be done, create X99ScriptName links in the rc[0-6].d directories pointing at your script. In that X99ScriptName name, the X is either K (call script with stop) or S (call with start) and 99 is a 2-digit number that is used to specify the time at which the script is run. Lower numbers get called sooner in the booting process. The [0-6] in the rc[0-6].d directory name is one of the 7 runlevels. The scripts that are linked to in each of the directories get called when the system enters that runlevel.

Run 'man telinit' to get an explanation of what runlevels are, and at what stage which one is entered.

Posted
Another Alternative would be using the task schedualer to run a batch file at start up.

but who actualy has the task sceduler task enabled? ;)

Well... if you are using Vista you have to... other wise alot of stuff stops working...

Posted

no i can not use the task scedualer it is disabled and it isn't even in the start menu. I can't even use the at command in command prompt. I get an "Access is denyed" label.

I tryed putting the batch files i wanted to run in the start menu, startup, and when ever i restart the computer there gone.

Posted

@cooper

Thanks i found /etc/init.d/boot.local it lets me pass commands that are executed before the first run level, so they're present in all. i also found that setting a low swappiness in here makes it boot faster.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...