question

ChristopherTrexler-5559 avatar image
0 Votes"
ChristopherTrexler-5559 asked ChristopherTrexler-5559 commented

opening files at a certain time

I would like to know if there is a Powershell ISE command to schedule a .flac file to open at a specific time (and a cancel command)

windows-server-powershell
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

try also invoke-item

0 Votes 0 ·
IanXue-MSFT avatar image
1 Vote"
IanXue-MSFT answered ChristopherTrexler-5559 commented

Hi,

You can register a scheduled task using the Register-ScheduledTask cmdlet.

 $Time = New-ScheduledTaskTrigger -At 12:00 -Once
 $User = "Contoso\Administrator"
 $PS = New-ScheduledTaskAction -Execute "C:\folder\a.flac"
 Register-ScheduledTask -TaskName "openflac" -Trigger $Time -User $User -Action $PS

To cancel the task run Unregister-ScheduledTask

 Unregister-ScheduledTask -TaskName "openflac"

https://docs.microsoft.com/en-us/powershell/module/scheduledtasks/register-scheduledtask
https://docs.microsoft.com/en-us/powershell/module/scheduledtasks/unregister-scheduledtask

Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I got an error saying "no mapping between account names and security IDs was done." what does this mean?

0 Votes 0 ·

is there any way it can be typed into a signal command line? script running is disabled

0 Votes 0 ·
AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered

hi @ChristopherTrexler-5559 ,

maybe this will help:

 Start-Process -Filepath "vlc.exe something.flac"
    
 Stop-Process -Name "vlc"

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/start-process?view=powershell-7.1
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/stop-process?view=powershell-7.1

Create scripts (start and stop script) and use the Task Scheduler to schedule the scripts.


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered ChristopherTrexler-5559 commented

If you can't run scripts you posted in the wrong area! :-)

You can try this, though: how-create-task-using-task-scheduler-command-prompt


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

command prompt is locked by admin my way of running commands is through the command line of Powershell ISE. EX.`Shutdown -s -t 00` the command line of Powershell isn't locked.

0 Votes 0 ·

I'm not the Admin of the device in questin

0 Votes 0 ·
RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered ChristopherTrexler-5559 commented

You can run SCHTASKS from the PowerShell shell as well as from the cmd shell. Start Powershell with "run as administrator".

Seems like you're trying to subvert the admin's blocking you from doing things. Why not discuss this with that person?

· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Im not trying to subvert the admins block im just trying to find another way after a failed attempt at swaping a alarms and clock file with one with the same name (with admin permission) 80642-for-q-a.png


0 Votes 0 ·
for-q-a.png (46.2 KiB)
RichMatheisen-8856 avatar image RichMatheisen-8856 ChristopherTrexler-5559 ·

Copy the script from the edit pane and paste it into the terminal window.

1 Vote 1 ·

How do I differentiate between AM and PM

0 Votes 0 ·
Show more comments