New answers tagged

0

For several reasons, ntpd does not like to correct large time discrepancies in a single swoop. What is does instead is to slew the clock gently, but this in turn means that it will catch up very slowly. In fact, the Manual states: -x Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and ...


0

You can redirect the command's output to the 'nul' device like this: TIMEOUT /NOBREAK >NUL For most commands, adding '>nul' to the end of the command will redirect the command's standard output to the nul device, which simply discards the output. Some output, particularly error output will still be written to the screen.


1

for /r %i in (*) do @echo %~ni or forfiles /s /c "cmd /c if @isdir==FALSE noquotes.bat @fname" assuming a file noquotes.bat in your %PATH% with this content @echo %~1 for /r approach explained for /r walks the current directory recursively (you can specify a directory for /r drive:\path\, the current directory is assumed) and executes the command ...


1

What did the trick for me was moving the command into a separate batch file: rem this first batch file triggers the second one: start the_second.bat arg1 arg2 out.txt the_second.bat then looks like this: python 1st.py %1 %2 > %3


0

I bet your password has a quotation mark (' or ") in it. Bash thinks that you've begun a multiline string/quote, so it gives you your $PS2 prompt on the second line, which is usually >. Make sure that your arguments are all properly escaped. Example: If your password is $jkl;'", then you can escape it with double quotes like "\$jkl;'\"". Alternatively,...


0

You also should try using Fusion in fullscreen versus the smaller window. This was the only way I could get Ctrl-Alt-FN-F3 to work.


1

Use head and tail. history | head -n 456 | tail -n 136 Which will get the first 456 (up to the end you want) and then you get the last 136 (which computes as 456 - 136 = 320, but will fetch from the 321st record from history).


-1

On just about any version of windows you can check the timestamp on the swap file. dir /a:h c:\pagefile.sys


0

Just share the folder c:\windows\system32\spool\printers in which the shared printer is connected for everyone with full control both in share and security menu. That will work fine.


0

Don't worry, created a Python script that done it for me. If anyone comes across this and needs something similar here is my code: import glob, os, zipfile zipfiles = glob.glob("*.zip") ## find all files with zip extension in current directory count = 0 ## current file while (count < len(zipfiles)): print ("Extracting file: "+zipfiles[count]) ...


5

There's usually nothing dangerous about adding directories to PATH. It could only cause you problems in two ways: While using a command prompt, you might accidentally run a program you didn't intend to. Then again, if you know the programs you put on your PATH, nothing malicious will happen. Programs might find DLLs there that usually aren't loaded. The ...


3

This is done by filtering by attributes. dir [somedir] /ad will show all entries with the "directory" attribute. It also shows junction points. From dir /?: Displays a list of files and subdirectories in a directory. DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [...


0

Q1: Can I automate this at e.g. Month or even Year level preserving the HOURLY zipping, as that is the whole point...? The way to automate this is to used nested for loops. The solution below is for the Month Level. Use the same approach with another level of nesting for a Year level solution. Run the following batch file (RecurseDays.cmd) in the ...


1

Wish I'd noticed this thread years ago. My solution was essentially the same as slhck's, but I wrote a script. I use it all the time. Posting here to share it. #!/bin/bash msg='all done' quiet=false if [ "$1" = '-q' ]; then quiet=true; shift; fi if [ $# -gt 0 ]; then msg="$*"; fi echo -ne "\x1b]0;$msg\a" if [ -x /usr/bin/zenity ]; then unset WINDOWID ...


3

Batch Script - Subtracting (or adding) Days from Current Day Simplified You can do this using a batch script that sets the date variable and subtracts 1 day (or any number of days for that matter) from the current date which the batch script is executed. So you'd need to ensure that the day you schedule the script to execute, that that day is what you ...


0

You can edit/copy/paste anything in the command line (actually the entire CMD window): Press Alt+space to see the options. In this case, press Alt+space E K Move the cursor to where you want to start a selection, hold down SHIFT while you move the cursor to the end of the selection. Press Alt+space E Y (or Alt+space Enter) to copy the selection. Press ...


0

Windows considers the clock a high-security setting (due to its use in TLS, Kerberos, and Event Logs) – allowing to change it over the network, anonymously, might not be wise. That said, access to change the clock is granted by SeSystemTimePrivilege, which can be given to arbitrary users via Group Policy or directly via secpol.msc (under Local Policies → ...


2

Well, this is awkward. Rebooting solved my problem. It seems like I did the right steps, but without reboot it wouldn't work. Maybe this can be of help for someone else in the future.


0

You can use wmic to query the ownership information like this: wmic path Win32_LogicalFileSecuritySetting where Path="C:\\windows\\winsxs" ASSOC /RESULTROLE:Owner /ASSOCCLASS:Win32_LogicalFileOwner /RESULTCLASS:Win32_SID Don't use dir since the ownership info may be clipped, as with this example directory. To get an output formatted with DOMAIN\USER you ...


1

I think it is always quite complicated to calculate dates. Therefore, I would like to propose an alternative solution to achieve what you need. I would use another scheduled task, to output the current date with the format YYYY-MM-DD in a file. You can find information on how to do that here. Then, in your scheduled job that is responsible for the zipping, ...


0

Try this. Go to Start Menu/All Programs/Accessories, right-click Command Prompt/Properties/Layout/Window Size, Width=80, Height=25.


0

This question is a typical XY problem. You tried to fix the slow MSU install and this can be done by running this batch file. It stops the Windows Update service before trying to install a MSU update. This speeds up the installation a lot.


0

I noticed I got this same issue when I ran Akinjides-MacBook-Pro:Desktop akinjide$ $SHELL The output was bash-3.2$ so the $SHELL keyword runs the shell specified by the SHELL environment variable. you can just type exit to leave. if you run Akinjides-MacBook-Pro:Desktop akinjide$ sudo -s The output was bash-3.2# According to man sudo -s [...


0

Run your VM from command line: VBoxManage startvm nameOfYourVBox --type headless Console access to your VM: You'll need an SSH server for Windows then ssh myUserName@myBoxIp Acces to Regedit: it's a graphical program, so you can't use it just from command line. An CLI alternate is the reg command, more info with reg /?.


1

Batch cannot do this directly. All Batch usually does is run external programs. There is some capability to jump/goto/loop, and variables can be used, although using variables is kind of painful. So, since most of what people do with Batch is to run external programs, your objective isn't going to be to learn Batch really well. Your objective will be to ...


1

On UNIX-like systems, the shell sh separates what you type into words and passes each word separately as an argument to the program or builtin-command referred to by the first word (the command name itself is the zeroth argument). Simplified, words are split on every space. Thus, cd .. is two words but cd.. is only one. There is no command named cd.. ...


1

Right-click on your shortcut Open Properties Open "Shortcut" tab Change the "Start in" field to the folder containing your batch file. By design, it defaults to the folder where the shortcut itself is. That way, the shortcut behaves exactly like an executable file, i.e. its current working directory at startup is the one it is located in. BTW, my Windows ...


1

Except for already mentioned /?, --help, reading documentation and googling there is no standard way to do it. Unfortunately, some programs don't document their switches well - there is (almost) nothing that can be done with those. This is why: each program analyzes its command line completely differently, and even having switches is just an agreement that ...


4

Is there any way to replace cd and dir with other programs? No, but you can come close - here's how: You can create a batch file called dir.cmd. @echo off setlocal echo I have replaced dir endlocal Example: F:\test>dir.cmd I have replaced dir F:\test> However you have to call it by its full name dir.cmd not just dir, unless… You can use ...


0

Most programs will accept the /? or -? switch to allow you to see what parameters the command will accept. Some GNU or *nix-based utilities (in layman's terms, a program mostly intended for Linux users, but also available for other platforms) require you to add --help for it to give you brief documentation. When all fails, of course, you can just use ...


0

libtool-bin is only available in Linux Mint Sarah (version 18) as you can see in this forum. Previous Mint versions don't include the package on their repositories. If you are using a Mint version different from 18 then you have to compile manually the package downloading it from GNU libtool.


0

So, ultimately, I ended up downloading the source and changing it to accommodate what I needed it to do.


0

Those are color/positions chars. You have 2 options 1)Ensure you ssh client support same terminal type you have in TERM variable. To get it use env|grep TERM 2) run asterisk console without color -n Disable ANSI colors even on terminals capable of displaying them. So use asterisk -rn


0

Check out mKiosk to see if it'll potentially suite your needs since you say "maybe there is another way to do this" . . . mKiosk: Kiosk Mode for Firefox Kiosk Mode for Firefox with optional Tabs Guides for Access Point. Complete solution. Block downloads/addon, bookmarks, reset kiosk inactivity, retry on errors, restricted interface, show ...


0

These may not be the solutions you are looking for but I figured I'd share these with you just in case you find any use out of any of them. I thought maybe the Firefox -Fullscreen switch would do the trick but it doesn't seem to work consistently. I thought it did at first but when I tried subsequent times it did not; therefore, I came up with a ...


0

If you are looking to get all network traffic between 192.168.1.158|64.12.24.50, you can run the following tshark command tshark -r mypcap.pcap 'ip.addr==192.168.1.158 and ip.addr==64.12.24.50' To change things up if you want to see all source traffic from your non-routable IP 192.168.1.158 and your destination aol IP address 64.12.24.50 (bos-m013a-...


0

Below is an example batch script I've used for plain insecure FTP using the build-in Windows FTP command line functions. I think you need to use for example mput "C:\Users\310176421\Desktop\test.txt" specifying a valid full path and the file name of the file where it exists for it to upload that file. If the file is not in the location you specify or if ...


0

I don't know of any way to make cmd exclude the current path. As a close approximation, though, you could use mkdir to make an empty directory in the current directory, cd into it, run your command, cd back up and remove the directory: SET _tempdir=%date%%time% MKDIR %_tempdir% CD %_tempdir% REM run commands ... CD .. RM %_tempdir% The empty directory ...


1

Install ConEmu and do the following: Press Win + Alt + P Go to "Features" Enable "Log console output (*)" Clear the line below "Log console output (*)" and change it to "%userprofile%\ConEmuLogs" Press the button which is at the top right. It should close or ConEmu might give you an error (ignore it unless it is about the log file) Close the tab you ...


0

Take a look at the documentation: https://ffmpeg.org/ffmpeg.html The two arguments "-ss" and "-t" serve different purposes if you use it as in input or an output option. Wether of both it is is set if they stand before the "-i" or before the output file.


1

From set /?: SET /P variable=[promptString] The prompt you want to display for the set /p goes after the equals sign. So: echo Please enter the IP Address to TELNET set /p IP_Addr=IP Address:


3

I have not personally installed it, but taking an excerpt from this article, it looks like no: Remember, software you install in the Bash shell is restricted to the Bash shell. You can’t access it from the Command Prompt, PowerShell, or elsewhere in Windows. Software in the Bash shell also can’t interact directly with or launch Windows programs, although ...


2

One way is to store the command(s) you want to pass to cmd in a batch file, then call the batch file instead of cmd. Eg, file.bat: wmic product where name="xxx" call uninstall /nointeractive Then call the script the same way you were attempting to, powershell.exe -Command "Start-Process file.bat -Verb RunAs"


1

For many Mac applications, there is a way to print from the command line, but who'd want to? (I'm kidding.) OS X has an easier way. Desktop Printer Icon The specifics are different depending on OS version, but for OS X El Capitan, it's easy to make a desktop printer icon. Open System Preferences->Printers & Scanners. Drag and drop a printer icon to the ...


0

To couple cygwin with ConEmu. Tested on ConEmu 160714 with terminals.v0.7.4.7z https://github.com/Maximus5/cygwin-connector/releases Extract conemu-cyg-64.exe from terminals.v0.7.4.7z and copied on C:\cygwin64\bin Modify the Predefined task on Settings->Startup->Tasks from set CHERE_INVOKING=1 & C:\CygWin64\bin\bash.exe --login -i -new_console:...


0

Below is what I used to locate misc video files that were taking up too much room on a network drive and write the results to a text file on a local PC. I'm posting my own somewhat late answer for three reasons. One, I like concise answers. Two, this single line of script worked in multiple settings for me, including across a network. Three, per Don Vince'...


2

You don't currently have permission to access this folder Try ICACLS and/or TAKEOWN with the below syntax against the folder with the username as needed. Try just the ICACLS commands first and if that doesn't resolve, run the TAKEOWN commands and then run the ICACLS commands again. ICACLS Commands Grant explicit full control access to this folder to ...


-1

Verify that the files are not Hidden or system files. If System try: forfiles -p "H:\SHARED\Scans" -s -m *.* -d -7 -c "cmd /c del /a-s @path" If Hidden Try: forfiles -p "H:\SHARED\Scans" -s -m *.* -d -7 -c "cmd /c del /a-h @path"


3

What you could do is the following: web.sh: #!/bin/bash systemctl $1 apache2 mysql The benefit of this solution is that you can do the following: sudo ./web.sh start to start everything. sudo ./web.sh stop to stop everything. sudo ./web.sh restart to restart. And so on...


-1

From an elevated command prompt use the following: netstat -a -b > C:\netstat.txt



Top 50 recent answers are included