Creating an Icon that will execute a text file / batch script

  • Thread starter Thread starter User1301
  • Start date Start date
  • Replies Replies 11
  • Views Views 2447

User1301

Deactivated
Deactivated
Joined
Jun 12, 2009
Posts
3,172
Country
S
Region
G
Hi folks,

Some hopefully fairly basic help please if you don't mind (basic to the Guru's I'm sure - I'm struggling a bit though).

Firstly I'm using Easynet from Amigakit with the wireless PCMCIA card (and also using Classic WB - full) and I would like my AMITCP Stack to launch after workbench launches without manually running it from the AMITCP folder (I'm sure I can figure that bit out myself but if someone knows off hand how to do this - that would be great) but mainly the thing I want to be able to do is execute (from an icon) the text file I've created that lets me run my SMB-Handler script which mounts my Server share.

What I do just now Manually is:

Run AMITCP (3.x or something) and then click go on line - all works perfectly :)
Launch a shell - then from the shell command run the following commands:
>CD sys:storage/dosdrivers
>Mount jmcserver:
This mounts my server share successfully and it all works well (jmcserver is the SMB-Handler text file that has all the parameters in it)

Essentially - automating the above is what I'm after, whether that's by creating icons or adding commands to the workbench startup or whatever :)

Cheers folks

J
 
You only need to have your script in a file and then make/copy an project icon with Default Tool "C:IconX" and you're set.
 
You'll need a project icon with the tooltype set to C:ICONX

Your "script" can be written in Ed or whatever - e.g:

CD sys:storage/dosdrivers
Mount jmcserver:
EndCLI
 
I have a habit of creating ascii files in the c: directory and adding the protection flag s to it. Project Icons are great for certain things but popping open a shell and typing mytcp or your name preference is just as nifty.

Once you've used cygnused or similair to create a file in c: you'd use a shell to type something like (since i can't remember the exact syntax I'm at work :p)

protect c:mytcp rwds

or is it

protect rwds c:mytcp

probably the prior but type protect by itself for the synax I don't think you need a pre - or anything :-)

ah, I used to live in the shell back in the day, I refused to even load a workbench LOL now look at me, struggling to recall a command line... It's what using DirOpus and filemanagers does to you! Argh!

---------- Post added at 20:07 ---------- Previous post was at 19:55 ----------

forgot to say (even thought it might be quite obvious) once it's all done

type mytcp in a shell and it will execute your commands and also close the shell window

Also a tip about script files; Some executables will run and won't return back to the shell so an endcli command won't work, in this instance you need to run a command called runback which is a better alternative to run >nil: for example which won't actually do the job anyway more than likely you'll get a CLI [2] or similair appear. Runback will completely detach the process/task and enable your endcli command to activate successfully, this will also work with your IconX project endevours!

adios! I'm getting way off down the river with this one LOL
 
Thanks folks - that's it done and working :)

You are Oracles indeed!

J
 
yep being able to make scripts executable is one great feature :)

IconX was one of the first 3rd party bit of software to make it into the official WB :)
 
On a separate note - and this should be so simple but I can't see how to do it but how do I get an icon on the actual workbench screen and make it stay there either as a pointer (shortcut) to the file I want to run please?

Cheers

John
 
LEAVE OUT (Amiga-L)
Highlighting an icon, then selecting LEAVE OUT will leave the icon out on the main Workbench screen. This allows you to access it easily without going through millions of subdirectories. To snapshot this highlight WINDOW/SNAPSHOT/ALL to remember its position for when you reboot and it will be in the same place as before.

And if you want to put it back later through boredom, the world will end if you don't, etc etc ...

PUT AWAY (Amiga-P)
Any icon that you have left out can be put back from where it originated from by highlighting this. The icon can then be snapshotted to remember its position.
 
You can also use the following command in your s:user-startup

EasyNet ONLINE >NIL:

Which puts EasyNet silently online in the background.
 
Thanks Blankstare - I don't remember ever knowing that at all - nice one mate! Just done it there and of course works a treat!

John

---------- Post added at 20:57 ---------- Previous post was at 20:56 ----------

You can also use the following command in your s:user-startup

EasyNet ONLINE >NIL:

Which puts EasyNet silently online in the background.

Oh and thanks for that too from my Number One supplier of choice :thumbsup: Just done that too hehe
 
Back
Top Bottom