You are here

scripting if/then/else

6 posts / 0 new
Last post
Allan Kirk
Offline
Last seen: 14 years 11 months ago
Joined: 2009-04-07 16:54
scripting if/then/else

Hi
Is there any way to do if/then/else statements in the scripts?
I would like to do some syncing, but want to make sure it only happens at my own computer. I'm thinking along the lines of:

If @computername@=XXX Then Sync MyJob

Then I could load the script from the autorun.inf, and it would only run on my own pc.

- Kirk

Ph4n70m
Ph4n70m's picture
Offline
Last seen: 1 year 9 months ago
Joined: 2007-01-12 19:22
.

Make a batch file!

@echo off
if %computername%==PUT_HERE_YOUR_COMPUTER_NAME (
start PortableApps\Toucan\Toucan.exe SOME_PARAMETERS_HERE
)

horusofoz
horusofoz's picture
Offline
Last seen: 6 months 3 weeks ago
Joined: 2008-04-03 22:45
Another scripting question

Is it possible to use Toucan to create a script that will open and run operations for a series of registry/system cleaners on my portable?

Basically I want it to:
1> Open CCleaner, scan and run cleaner. Close CCleaner.
2> Open and Run clean with CleanAfterMe. Close CleanAfterMe.
3> Open and Run clean with Disk Cleaner. Close Disk Cleaner.
4> Open Regseeker and do Autoclean. Close Regseeker.
5> Open Regpair, scan and fixerrors. Close Regpair.
6> Run JKDefrag and perform Defragment and optimize on all connected drives (Portable hard drive and local hard drive). Close JKDefrag.

All these apps are on my portable hard drive installed into the PortableApps folder. I think I could figure how to make a scrip in Toucan to open them as it would be "Execute X:\PortbaleApps\App\App.exe" but I'm guessing this would only just open the app. I want it to actually run the operations.

If this cant be done completely within Toucan would it be possible to create a regular script and Execute that script within Toucan? if so how does one create one of those .bat scripts? Also would it need to be converted to an exe to be recognized by Toucan's execute function?

Thanks in advance for any help Smile

PortableApps.com Advocate

Steve Lamerton
Steve Lamerton's picture
Offline
Last seen: 10 years 6 months ago
Developer
Joined: 2005-12-10 15:22
Yes

it would only run them I am afraid, however I suspect many of those prorams have command line options you could use to run them automatically, I shall try and get support for command line parameter passing added into the next pre-release.

And you should be able to run a bat through the Execute command without any problems.

EDIT: Actually you can already pass parameters, for example:

Execute "notepad C:\test.txt"

Works just fine, the only problems you might have are is you need to pass quotes to the command line, I need to think about a better solution for that though

Steve Lamerton
Steve Lamerton's picture
Offline
Last seen: 10 years 6 months ago
Developer
Joined: 2005-12-10 15:22
I

have been thinking about this, I should have support for this added in the next pre-release, I will add more information once I have got it sorted.

horusofoz
horusofoz's picture
Offline
Last seen: 6 months 3 weeks ago
Joined: 2008-04-03 22:45
Thank you Steve :-)

Thank you Steve Smile

PortableApps.com Advocate

Log in or register to post comments