Error on remote task run with "schtasks /run /s" - windows

I want to run a task remotely. Therefore I created a .bat with
schtasks /run /s 111.20.123.160 /u Administrator /p password /tn "Task"
I just get an error: "FEHLER: Die Anforderung wird nicht unterstützt."
I also tried different users (normal and admin) and computername or IP.
My system: Win7, remote system: WinXP ... are there known issues?

Of course. schtasks controls the new task scheduler introduced with Windows Vista. XP still uses the ancient one that dates back to Windows 2000. The respective capabilities are vastly different for one and the interface as well. So while both at and schtasks work on a current system (because the old interface is mapped onto the new one), XP simply does not have the new task scheduler version which schtasks manages. No surprise here that it simply won't work.
You can try doing the same with at.

While not ideal, you could also just copy the 'Schtasks' from XP and put it in another folder on the Windows 7 machine or put it in your 'System32' folder on the W7 box but rename it to 'XPSchedTask'. Then when you need to execute a scheduled task on a Windows XP box, you just call 'XPSchedTask' instead of 'SchedTask'

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.

how to start VMWARE player 6 on Windows 7 from Windows .bat file

I want VMWARE to start automatically when I restart Windows 7.
So, I want the command line for this in a .bat file that my Windows startup can call.
I've just noticed you mentioned what VMware Application you're using in question's subject.
VMware Player is now VMware Workstation Player.
I can find no topics related to this in 6.0 version, so I don't think it's possible. Anyway, you may try doing the following:
Add vmplayer.exe to Startup Programs in start menu
Register a scheduled task "On Startup" for vmplayer.exe
Run vmplayer.exe from it's root folder via cmd, that would be something like
C:\Program Files (x86)\VMware\VMware Player\vmplayer.exe
If you're trying to start a virtual machine, you can do it by running the command above plus adding the "-x" parameter, as said just in Workstation Documentation, page 486.
I hope it helps!
There is a couple of bugs in the installer of VMWare player 6. You should swap these values in the Windows registry :
HKEY_CLASSES_ROOT\Applications\vmplayer.exe\shell\open
HKEY_CLASSES_ROOT\Applications\vmplayer.exe\shell\open\command
Then add this key :
HKEY_CLASSES_ROOT.vmx\OpenWithList\vmplayer.exe
Assuming your Virtual image is in C:\Users\stackoverflow\, your batch file should be similar to this :
start "" /low "C:\Program Files (x86)\VMware\VMware Workstation\vmplayer.exe" "C:\Users\stackoverflow\Win10.vmx"
Assuming the open verbs are correctly set in the registry (see #Doe Doe's post) you can just use:
start "path\to\my_vm.vmx"

How do I run a windows task without flashing a command prompt box BUT still show a dialog box when I need to?

I creating a scheduled task in windows using windows command prompt:
schtasks /create /sc minute /mo 30 /tn "javadobe" /tr "\Program Files (x86)\BuildingIntelligence\javadobe\node.exe '\Program Files (x86)\BuildingIntelligence\javadobe\index.js'" /RL HIGHEST
Which is telling the command line to run "node index.js" every 30 minutes with the highest running privileges.
In my index.js file, I am checking a remote server for a version number I compare against a local version number. Now when they are the same, a node prompt window flashes briefly on the screen, which is obnoxious, and I would like to stop.
However, when the host server uploads a new version of the software, I show a dialog box asking the user if they want to install the update now or later. I want to keep this functionality.
How can I keep the dialog box popping up but not show the node.js command prompt flashing all the time?
Things I have tried:
I have tried running my script as a service instead of a scheduled task, which keeps the windows command prompt from appearing, but doesn't allow the dialog box to appear to the user (because services run in a different desktop session).
In normal windows command prompt, you can start a program minimized, using
START /MIN [application name]
and so I tried changing my /tr argument to "start node index.js /MIN" but that didn't work.
Thanks a bunch in advance for any help!
Whether or not Windows creates a console window for an application is controlled by the Windows Subsystem specified in the binary image (exe file) — something specified at compile time.
If this is CONSOLE (as node.js is), Windows creates the console window before the application begins executing. In other words, it is impossible to control at runtime whether or not a window appears. If WINDOWS, Windows does not create a console window, as it expects the application to create UI.
You will have to create a custom build of the node.js executable with subsystem WINDOWS.

PowerShell File monitor at Windows startup

I have a file system monitoring PowerShell script using System.IO.FileSystemWatcher events.
The script works great, but it requires an open PowerShell window.
Thus, I need to run it as a Windows Service at Windows startup (without logon). Is there a way to do this?
To execute your script at windows startup (without logon) you could create a windows service for it (using srvany.exe).
Steps:
Get the windows 2003 resource kit (which contains srvany.exe)
Install the resource kit
Create the service using sc and srvany.exe
sc create PSService binPath= "C:\Program Files\Windows Resource Kits\Tools\srvany.exe" DisplayName= "PSService"
Parametrize your service
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\PSService]
"Type"=dword:00000010
"Start"=dword:00000003
"ErrorControl"=dword:00000001
"DisplayName"="PSService"
"ObjectName"="LocalSystem"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\PSService\Parameters]
"Application"="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -noExit -ExecutionPolicy RemoteSigned -File C:\\PSService\\psservice.ps1"
Some remarks:
Srvany.exe is not available for Windows Vista and up. It might work, but it's probably not supported
You might want to run it with other credentials (for security reasons)
You might want to save your script in a directory where only administrators have write access (for security reasons)

Running Batch File in background when windows boots up

How do I run a batch file each time windows boots up also I need to run it in the back ground(without that command window getting displayed)? I use Windows Xp.
My actuall requirement is I want to start the Tracd server using the command line commands whenever Windows boots up.
Add your program in the registry:
Run - These are the most common startup locations for programs to install auto start from. By default these keys are not executed in Safe mode. If you prefix the value of these keys with an asterisk, *, is will run in Safe Mode.
Registry Keys:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run registry key
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run registry key
Then you can launch your batch in an invisible mode:
wscript.exe "C:\yourpath\invis.vbs" "your_file.bat"
In invis.vbs put...
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
Two other startup posibilties:
you could always add the bat file to the startup folder,
or start it as a Scheduled task setting to run on logon.
You can make an application run as a service.
Check this article for details:
You can use autoexnt for this. It was original designed for windows NT, but is still working in newer versions of windows.
You have to download the Windows 2003 Resource Kit to get it.
There's also hstart, a third party program that's worked well for my needs. It's maintained too. The last version was released on July 7, 2010.

Resources