task scheduler + windows 7 + won't run task - windows-7

I have a script that I can run from its directory giving this command:
c:\Users\UserName\Desktop\Folder\V3>C:\Windows\Syste
m32\WScript.exe "c:\Users\UserName\Desktop\Folder\V3\filename.vbs"
but if I try and do it from this location c:\
c:\>C:\Windows\Syste
m32\WScript.exe "c:\Users\UserName\Desktop\Folder\V3\filename.vbs"
I get permission denied, and I do not understand fully.
What permission do I have to have for this to work?
Note: I am trying to schedule this task in task Scheduler Windows7 which has led me to this question as this is what the task scheduler does.
I do not have local admin rights.
found this useful re trying to solve this.
I am just unsure of my permissions.

worked this out see here
Basically itt turns out I have to put the location of every script.vbs in the Start in: (optional) parmaeter of the Action tab for each schedule.

Related

Can't enable/disable a custom task neither from cmd nor with .bat/.vbs files

On another computer running win7 Pro i had no issue and i was using my.bat file with success. Now on my new win10 Home computer i get this error:
C:\Users\User>schtasks /change /tn "AlarmClockEarly" /ENABLE
ERROR: Access is denied.
But if i run the actual state of the task (for example if it is already disabled) i get this:
INFO: Scheduled task "AlarmClockEarly" has already been disabled.
SUCCESS: The parameters of scheduled task "AlarmClockEarly" have been changed.
The task as you can see is a custom made and i don't try to mess with Windows like disabling Updates or something plus i already checked the run with highest priviledges
I run cmd as an Administrator
I am already the Admin account in this PC
I also tried running the command and the .bat itself from the place it is stored C:\Users\User\Scripts>
Can't remember how many things i tried while searching for a solution. So you are my best hope and thank you in advance.
Well i found the solution and for anyone searching the same you ll have to go to C:\windows\system32 then find cmd and go to Properties -> Security. While SYSTEM is highlighted press Advanced at the bottom right and change the Owner from whatever to your account.

Run FORMAT command from task scheduler

I'm trying to get a scheduled Format running on Win10.
I have a Batch File that consists of the following line:
Format F: /V:test /Q /FS:NTFS /A:4096
Starting the Batch manually Formats the drive as desired, but starting the Batch as a Scheduled Task gives me an error:
cannot open volume for direct access.
I did a lot of Google Research but nobody seems to have found a solution or hasn't shared one.
I already did try/ensured the following things:
The Task runs with highest privileges
The user has admin rights and full Control over the Folder
I tried running it from SYSTEM - didn't work
The Task is configured for Win10 and running only as user is logged on

Microsoft Azure Backup (MARS) not running from scheduled tasks

We've got several servers running MAR's the lastest version 2.0.9145.0
I can run all backup's manually and its runs without problems. But when i try to run it from scehduled backups it shows in task scheduler that its run but gives this error code:2147942401
If i manually input the arguements into powershell it runs fine. However the task scheduler is not kicking in the backups.
I've altered the permissions to a domain admin, changed PS path to syswow64. So now i'm lost.
Has anyone had similar and any ideas on how to fix it or at least run the commands from a bat file instead?

Run exe as admin after install

I need to run an AutoIt program with administrator privileges. I use #requireadmin while installing. Is that enough to run the program after install with administrative privileges without using #requireadmin or should I try something else?
You must use #requireadmin in the 2nd program because it is affects current script only.
When you install your program and it is run with admin privileges, you can create a scheduled task that has the "run with highest privileges" option set. Then later when your application is run without admin privileges it can run this task in order to gain admin privileges.
Search around for ObjCreate("Schedule.Service") or for task scheduler UDFs for how to do this. Also for examples and documentation for the task scheduler com object in windows here.

Is there any way to open the CMD through teamcity so it will open and displayed on the desktop?

I have a batch job that i want to deploy from Teamcity to several servers,
to access several servers i use Winexe tool.
the batch is running but i can't see the session because it's started from teamcity,
but i can see that its running when looking at the process list.
My issue is that sometimes this job is having some errors,
which are being displayed on the cmd window when i run it manualy
but since i'm running it through TeamCity i can't see the CMD window so i can't see the error.
My question is:
Is there any way to open the CMD through teamcity so it will open and displayed on the desktop when i access the server as the same user?
note: bare in mind that i need to deploy it to several servers so i can't install several
agents via ZIP File.
So I found kind of a work-around to solve this problem,
I created a schedule task in windows that will run my batch.
when creating this task you need to set those settings:
1.) Run as: the user name that TeamCity is logging in.
2.) check the Run only if logged on check box.
3.) in the security tab give the user you use full permitions.
In order to run the schedule task you need to run this batch script:
Schtasks.exe /Run /TN name_of_schedule_task

Resources