How can i autostart ngrok on Windows ? Scheduled tasks command do not work.
schtasks /create /tn "start" /sc onstart /delay 0000:30 /ru system /tr "C:\ngrok-stable-windows-amd64\ngrok.exe http 80"
Create a text file with the command you want to run. Save it as a bat file in the same folder as the ngrok exe file. Create a shortcut of the bat file in the windows startup folder (Windows Key + R, type shell:startup).
Related
I have a task to run a bat file locally to schedule a task to open a website i used jenkins to automate it i used start cmd.exe /c SCHTASKS /CREATE /TN "myftp" /TR %TN% /SC daily /ST 14:48:00 it is creating with local cmd but not jenkins windows
batch shell
I have a .vbs file which I execute using cscript. Now that the script is sable; I want to run in background all the time.
Hence, I want this .vbs file to run as a service.
How do I create (install) it?
Scripts are usually not prepared to run as a service (they don't provide the interfaces required for managing the service). You're probably better off creating a scheduled task that launches your script at system boot (or at logon).
schtasks /create /sc onstart /tn "name" /tr "cscript.exe C:\path\to\your.vbs" /ru SYSTEM
I am trying to schedule a task with cmd prompt.The command that I am running is:
C:\Windows\system32\schtasks.exe /CREATE /SC ONLOGON /TN "mytask" /TR "C:\samp.txt" /RU "NT AUTHORITY\SYSTEM" /RP /F
The task is showing in task manager with username as SYSTEM ,and its status is Running with code 0x41301.But it(samp.txt) is not showing in desktop.
The same command if I am replacing the "NT AUTHORITY\SYSTEM" with currently logged on user then it(samp.txt) is showing on desktop.
How can I make the task to display on desktop with /RU "NT AUTHORITY\SYSTEM"
Did you try to add /IT ?
This is the only option which may allow you to display something on the active session using scheduled tasks. However, I am not sure that Windows will allow to interact with the desktop of another user.
Edit : You may use /RU BUILTIN\Users /IT, so any user will be able to run it interactively. What is you constraint on /RU system ?
If your goal is to display the samp.txt file content when a user logs on, another solution is to put the samp.txt in the startup folder of the "all users" start menu : C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
could you try with psexec ?
your command will be something like :
PSEXEC -i -s -d -w c:\ notepad.exe samp.txt
I am setting custom schtasks in windows using php to write and execute .bat files like this one:
schtasks /create /tn "RA AUTOMATIC BACKUP" /tr "\"C:\Program Files (x86)\MBM Software\Apache\htdocs\ra\automatic_backup\scriptspg_backup.bat\"" /ru "ProiectIM3" /rp "parola1" /sc minute /mo 1
The touble starts now:
1) if i don't use "\" after /tr the schedule tasks has the action: C:\Program Files and the rest is viewed like an argument
2) if i use "\" the schedule has the right action written:
"C:\Program Files (x86)\MBM Software\Apache\htdocs\ra\automatic_backup\scripts\pg_backup.bat" (quotes included)
BUT it will not run, on the other hand if i click on browse, set up the same file the action becomes
"C:\Program Files (x86)\MBM Software\Apache\htdocs\ra\automatic_backup\scripts\pg_backup.bat" (quotes included) and IT RUNS so the paths are EXACTLY the same but will not run with the first.
I am out of ideeas.
what is your OS and OS language? the /SC parameter is language-specific on old OSes. I.e. it is MINUTO, not MINUTE on Portuguese Windows XP. Also, try to include computer or domain name in the user's name
I want to know how to schedule a task using the command prompt.
Now I know you can probably find this on the internet, but I haven't found what I've been looking for.
The problem is that the operating system I have to do it on is in Swedish (Windows Server 2003 in Swedish).
It needs to run a program located at: 'C:\Documents and Setting\Administratör\Skrivbord\Midnight.exe'.
It should run around midnight, every day.
Does anybody know how to schedule this in cmd?
I do have administrator rights, so privileges shouldn't be a problem.
Just use schtasks windows utility in a .bat file or manually in CMD :
schtasks /create /ru Admin /rp paswd /tn "daily work" /tr "C:\Documents and Setting\Administratör\Skrivbord\Midnight.exe" /sc daily /st 23:55:00
Swedish should'nt be a special case :)
off course /ru is the username which we'll be used to run the task
You want the AT command to put an entry in the scheduler service TechNet on AT