I tried to starte memcache on windows 32 bit using the below command from cmd:-
D:\sw\memcache\memcached-1.4.5-x86\memcached-x86>memcached.exe -d
This is the error i am getting:-
Failed to ignore SIGHUP: Result too large
Has the command changed for starting 1.4.5 version?
I tried the below option also :-
B) Installation of memcached >= 1.4.5:
Extract the memcached windows binary to any directory.
In version 1.4.5 or later, memcached cannot run as a service. It must be started as a normal process using the task scheduler. To configure the memcached process to run automatically every time windows start, run a command prompt and type the following:
schtasks /create /sc onstart /tn memcached /tr "'c:\memcached\memcached.exe' -m 512"
Meanwhile, to remove the scheduled memcached task, run the following command:
schtasks /delete /tn memcached
But i am getting an access denied error message then. Do we need to give any special access rights for running memcahe.
Note:- I am totally new to memcache.
This command should be run as administrator. You have to right-click the command prompt and use the option to "Open as Administrator".
According to the information on this page:
https://commaster.net/content/installing-memcached-windows
version 1.4.5 or later can not be installed as a service. It must be installed as a Windows task.
To create this tasks via command line (or batch file), do in a manner similar to the example below:
CREATE TWO MEMCACHED TASKS
SCHTASKS /create /sc onstart /ru system /tn memcached1 /tr "C:\Xampp\memcached\memcached.exe -m64 -p11211"
SCHTASKS /create /sc onstart /ru system /tn memcached2 /tr "C:\Xampp\memcached\memcached.exe -m256 -p11212"
The tasks above will run on restart. Note the different amount of memory and port number, on every instance.
There are 2 ways to run the memcached on Windows:
Right click on the memcached.exe file and click on "Run as administrator", it will start the memcached.
Press "Window"+R, then type "cmd" and then press "Ctrl+Shift+Enter". It run it as administrator. Ten go to the lication of the file and use "memcached.exe -start" to run the memcached.
Hope this will help someone.
Related
I created a task with the task scheduler in windows 10 to open cmd.exe. it ran successfully like this
But I need to run some commands every time it opens something like this
and automatically runs this command.
this is important that it opens a command prompt first and then runs the command inside the command prompt automatically.
Thanks.
Use /k flag. See cmd.exe /k switch.
If you don't need console window to stay after commands completed use /c flag. You can read more about them with cmd /?
I've created a setup file using InstallShield Limited Edition, and I have a custom action that creates a scheduled task in the "After Setup Completed Success dialog" custom actions folder for installation:
schtasks.exe /create /xml "[INSTALLDIR]\task definition.xml" /tn "My Task"
If I run the setup as administrator, or I start it from a system context, everything goes fine.
However, if I run it silently, with the /S /v/qn command line parameters, everything works except for the task, which is not created.
How can I create the task also with a silent installation?
Lots of reason this could happen. If for example you have this running as a custom action in your UI sequence, the UI sequence doesn't run under a silent install. You would need to put it in the Execute sequence.
I would like to have the console window kept open when running a scheduled task which executes a batch file. If I run it manually meaning execute the batch file the window stays open but through task scheduler it doesn't open but I can see the task is still running. I put a pause at the end to do this.
#echo off
TITLE PROCESS_MGR
tasklist /FI "IMAGENAME eq JOESMO.exe" | find /I "JOESMO.exe">nul &&(echo PROCESS
JOESMO.exe IS ALREADY RUNNING!
echo %DATE%
echo %TIME%
pause
) || (
echo JOESMO PROCESS IS NOT RUNNING
cmd /c start "JOESMO.exe" "C:\Users\xxxx\Documents\
Visual Studio 2010\Projects\Projects2013\JOESMO.exe"
pause)
I found this suggestion cmd /k myscript.bat but having creating the task in task scheduler for windows server 2008 I am not sure where to apply this. I added /k to the add arguments box in edit action in task.
In the Scheduled Task dialog, just before the name of the batch file it's going to run (it's labeled Program/script. You now have something like:
myscript.bat
Change it to
cmd
Add the following to the **Add Arguments (optional) entry:
/k "C:\My Batch File Folder\MyScript.bat"
Tested on my system (Win7 64-bit), and it worked perfectly. I'm looking at the open command window it created as I type this text. :-)
Unfortunately Ken's solution didn't work for me on a Windows 2008 R2 Std server, I was able to launch an interactive window by modifying the scheduled tasks setting using schtasks.exe
In a command window I did the following command:
schtasks /Change /TN "My Task" /IT
However that does require you be logged in as the same user context in which the scheduled task is executing. So if your scheduled task is use the localsystem "taskaccount" then you will have to log into the system as the "taskaccount" user.
Oddly enough it worked when I manually run the task but it didn't pop for me when it kicked off at a scheduled time.
Ken's answer didn't worked for me.
Found this way of doing :
in your BAT file (create one if you only have an EXE) :
start C:/Absolute/Path/To/MyScript.exe myScriptArg
works like a charm !
Note: In the scheduled task, you must check "Exec only if user is logged"
Create a shortcut to the Batchfile and put that in the action. Worked for me
I tried all of the above, but they did not work for me. Here is what I did to get this to work:
Platform
Windows Server 2003 R2 SP2
ActivePERL v5.10.1
Steps
Create DOS BATCH script -- this runs the actual program, ie, myscript.bat
Create PERL script to call the DOS batch script, ie, myscript.pl
myscript.pl is a 1-line script: system("e:\scripts\myscript.bat");
Create scheduled task: perl myscript.pl
The DOS command prompt window now always opens up. And more importantly, the task now successfully runs and completes. NOTE: The scheduled task RunAs user is logged in to the server.
I need some help setting up a batch file in Windows 7. I want the batch file to be able to create a scheduled task that would execute 1 hour from the moment I click it. I don't want to manually have to put the date and time in, just want it to schedule a task that will execute a set number of hours after I have run the batch file (I'm using 1 as an example).
Please can somebody help me out. I've been searching for an answer all day to no avail.
Recent versions of Windows come with a DOS utility called WAITFOR. Depending on how interactive you want your batch file, and whether it should run a single static command or run whatever you need at the time, you could easily make it work. Like for instance, you could create a batch file on your desktop and drag a program to it and drop it on the batch file. The first thing it would do is prompt for the number of minutes to delay, then it could run the program you dropped on it.
#echo off
setlocal enabledelayedexpansion
set /p _min=Enter the minutes to delay:
set /a _min*=60
waitfor /t !_min! delay
start "" %1
setlocal
Using the start command makes it possible to drop other things too, like a BMP or Word DOC. Anything that you can launch by double-clicking it from Windows Explorer should launch just fine.
After you enter the minutes to delay, just minimize the DOS window. It will close automatically after the delay and after it launches the program or file you dropped on the batch file.
invoke windows task scheduler directly from command line
schtasks /create /TN "Task Name" /TR script.bat /ST 18:00 /SD 21/03/2014 /SC ONCE
We have a printer driver that we need to build for all OS's from Windows XP to Windows 8, both x86 and x64 versions. I can do this manually using the WDK free build environments, but I need to automate the process - start a batch script and have all my builds ready.
Does anyone know how to do this?
Command-line windows for x86/x64 Debug/Release and various OS platforms differ only in enviroment variables. The scripts setting the environment variables are already available in DDK or Visual Studio. (To find out script names check properties of corrseponding command window shortcuts.) So the problem comes down to writing a Windows batch file setting environment variables and invoking build commands one by one. Most likely environment variables for each next platform overwrite ones from previous platform, but to be safe you can start each build in a separate clean cmd.exe process. Here is the main script:
start /W "cmd /C build_winxp_x86_debug.cmd"
start /W "cmd /C build_winxp_x64_debug.cmd"
...
start /W "cmd /C build_win8_x86.cmd"
start /W "cmd /C build_win8_x64.cmd"
Start /w waits for spawned cmd.exe process termination before executing the next line. Cmd /c terminates when corresponding build script completes.
Example of build script:
#rem Script setting environment variables from DDK
ddkpath\setenv.bat XP x86 dbg
#rem your build commands
cd your_driver_dir
build -cz