How to use the 'at' command on cygwin? - cygwin

How can we schedule processes using the 'at command on cygwin'? 'The at command has been deprecated on cygwin'is the error I got on trying out the 'at command.' Are there any equivalent commands in Cygwin for at and batch?

Here is an example of how I used schtasks.exe in the same way I'd use at
schtasks /create /tn "Run Meter" /ru System /tr "nssm.exe restart Meter" /sc once /st 12:00
is functionally identical to
at 12:00 <<<"nssm.exe restart Meter"

AT isn't a Cygwin-specific program, it's part of Windows. The complete message says:
The AT command has been deprecated. Please use schtasks.exe instead.
You can run schtasks from cygwin, too. For immediate help with schtasks, from cygwin you can type:
schtasks /?
Otherwise, Google is your friend. :)

Related

Issue using The Task Scheduler with cmd

Can Windows 10 The Task Scheduler run Reg.exe commands from command prompt?
When I past this command to make changes in reg.exe in CMD -- its works! But not works at Task Scheduler!
Reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "SystemUsesLightTheme" /t REG_DWORD /d "0" /f"
able to scheduler but not work command line (trying scheduler work at 18 PM)
schtasks /create /sc daily /tn "Tema" /tr "Reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "SystemUsesLightTheme" /t REG_DWORD /d "0" /st {hora} /f
deleting command thas works too
schtasks /delete /tn "Tema" /f
I able to Create and Delete it as well, but I can't make it runs appropriately from Task Scheduler -- nothing happens!

Spawning bash time from Node.js Child Process

I am using child_process.exec() to execute the command time <my application>.
If I run this command in the terminal, my application is timed with Linux's time(1) command. However when executing the same command from a Node.js script child_process.exec(time <my application>);, my application is timed with GNU Time instead.
This is problematic because I need the millisecond precision of time(1) which GNU Time does not provide.
How can I call time(1) from child_process.exec()? I have tried giving the full path to time(1) instead of just time, however this did not have any effect.
Answering my own question: I was successfully able to enforce use of time(1) by wrapping my command in the following format: child_process.exec(/bin/bash -c "time <my application>").

Inno Setup: How can I give a serial number to installer when I execute it silently in command line?

As stated in the title, I want to know how I can give a serial number to installer when I execute it silently in command line.
.iss:
[Setup]
DefaultUserInfoSerial={param:serialnumber|Default serial}
Command line:
setup.exe /silent /serialnumber=12345
Don't forget about UsePreviousUserInfo.

Windows 8 Powershell Enable-WindowsOptionalFeature bat file

I have a .bat file that runs a powershell script. This is it
powershell -Command "& {Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole}"
I have done this before and if I wanted to add another command I would put a semicolon before the closing brace and continue the script.
This command however after completed requires that I choose wheter or not to restart the computer with a Y or N.
Does anyone know how to pass this in an argument or avoid this step all together?
Thanks in advance
Note: you have to run the .bat file as adminstrator
From Get-Help Enable-WindowsOptionalFeature -Full:
-NoRestart [<SwitchParameter>]
Suppresses reboot. If a reboot is not required, this command does nothing. This option will keep the
application from prompting for a restart or keep it from restarting automatically.
Add the -NoRestart flag to Enable-WindowsOptionFeature to suppress the reboot. If you do want to reboot after completion, use the command Restart-Computer.

Application autostart after system boot for a random interval in Linux

Reading 'sleep' mans and googling haven't provide any useful information.
I want to run Pidgin after Ubuntu boots, but after some time left. For example, logon is passed, and after interval for 1 to 5 minutes Pidgin starts. As manuals of 'sleep' says, there a way to specify only number of hours, mins and seconds.
Is there any way/other linux command to solve my problem?
look like you could use linux at command. Create a bash script containing something like this, replacing /path/to/pidgin with your actual path (you can run $ whereis pidgin to find out the location):
at now + 5 min <<_EOF_
DISPLAY=:0.0 /path/to/pidgin
_EOF_
check out Files and scripts that execute on boot to see where you can place that file.
cron would be another option

Resources