Windows 10: && Weirdness

Discus and support && Weirdness in Windows 10 Support to solve the problem; Code: runas /user:Administrator "defrag c: /V"[/quote] This works. Code: runas /user:Administrator "cleanmgr /VERYLOWDISK"[/quote] This works.... Discussion in 'Windows 10 Support' started by jnich, Apr 22, 2017.

  1. jnich Win User

    && Weirdness


    Code: runas /user:Administrator "defrag c: /V"[/quote] This works.
    Code: runas /user:Administrator "cleanmgr /VERYLOWDISK"[/quote] This works.
    Code: runas /user:Administrator "defrag c: /V" && "cleanmgr /VERYLOWDISK"[/quote] This does not work.

    I've tried /savecred thinking it might be some silly privilege issue, but that doesn't work either.
    Where did I go wrong?

    :)
     
    jnich, Apr 22, 2017
    #1

  2. Internet Connection Sharing broken Windows 10

    Can't mark your own replies as an answer.
     
    &&&&&&, Apr 22, 2017
    #2
  3. saabvert Win User
    Sirocco 8800

    Link went weird, sorry

    /discussions/board/message?board.id=music&;message.id=2651&view=by_date_ascending&page=2
     
    saabvert, Apr 22, 2017
    #3
  4. sml156 Win User

    && Weirdness

    Try a semicolon ​; ​ in powershell
     
    sml156, Apr 23, 2017
    #4
  5. Bree New Member
    In a command prompt a single & acts as a delimiter between two commands, effectively allowing you to enter a sequence of commands on one line as if you had typed each command after the previous one had completed.

    The double && is similar, but will only execute the command following the && if the previous command was successful. It may be that your first command didn't return a 'success' code.

    https://www.microsoft.com/resources/...loverview.mspx
     
  6. jnich Win User
    That's good to know, but it appears to skip over the second command in PowerShell.

    If I use & instead of && in CMD, it still skips the second command and gives me this error.
    >The system cannot find the path specified.

    Code: runas /user:Administrator ("defrag c: /V" & "cleanmgr /VERYLOWDISK")[/quote] If I use nesting, neither command works and I get two cannot find path errors.
     
    jnich, Apr 23, 2017
    #6
  7. Fafhrd Win User
    Observation (may or may not affect outcome):

    If you run the cleanmgr command first, and some files are removed, followed by the defrag command, if successful, there will be fewer files to defrag, and there will be more space on disk for defrag to operate with, and fill gaps, resulting in a faster overall time, and a neater result on disk than the other way around..
     
    Fafhrd, Apr 23, 2017
    #7
  8. jnich Win User

    && Weirdness

    Yes, the ordering was not very bright on my part. The outcome is still the same with only the first command being run.
     
    jnich, Apr 23, 2017
    #8
  9. bro67 Win User
    Running those commands all of the time is just wearing down your hard drive, especially if you have a SSD. You should never run those commands, unless you have made major changes such as an upgrade to the next step version of Windows 10, or have removed a bunch of files that have been moved to another drive.
     
    bro67, Apr 23, 2017
    #9
  10. jnich Win User
    I'm keenly aware. My intention is to write a one liner or batch script which does manual routine maintenance like defrag (on HDD), disk clean, defender update and scan, and windows update. I would like to write out a log of each process as well, but this is a secondary issue.
     
    jnich, Apr 23, 2017
    #10
  11. bro67 Win User
    You do not need to do one, since it actually causes Windows 10 to screw up its built in housekeeping duties and slows down your system. As I stated before, you do not have to do any of this, since Windows 10 automatically looks at the hard drive and defrags it as part of its housekeeping when booting up or shutting down it records that info for it to happen the next time you turn the system back on or reboot.

    The only time you have to use Disk Cleanup is after a in place upgrade or doing a clean install and having updates installed, along with installing programs on the machine.
     
    bro67, Apr 23, 2017
    #11
  12. jnich Win User
    Please forget the programs I'm using since they are irrelevant to the issue at hand.
    Code: mkdir new && cd new && echo 'test' > 1.txt[/quote] Why would this work as a regular user?
    Code: runas /user:Administrator mkdir new && cd new && echo 'test' > 1.txt[/quote] ...but not this?
    Code: runas /user:Administrator "mkdir new && cd new && echo 'test' > 1.txt"[/quote] ..or this?
     
    jnich, Apr 23, 2017
    #12
  13. Pyprohly Win User

    && Weirdness

    Code: runas /user:Administrator "cmd /c \"defrag c: /V ^&^& cleanmgr /VERYLOWDISK\""[/quote] Code: runas /user:Administrator "cmd /c \"cd /d \"%cd%\" ^& mkdir new ^&^& cd new ^&^& echo 'test' ^> 1.txt\""[/quote]
     
    Pyprohly, Apr 23, 2017
    #13
  14. bro67 Win User
    fafhrd explained why it skips over one command to do the other. When you are doing dishes, do you take the dirty ones and put them away or do you empty the dishwasher, put the dirty dishes in and the clean ones away. Also do you put a couple of items in and then run it, or go "Hey, it still has enough room, so I will just put stuff in there until it is full and then run it."

    Same way when you look at anything that has to deal with analytical thinking, which every OS is designed to talk between the kernel, every piece of hardware through IRQ's, telling programs and tasks if they need to run or wait, housekeeping does not need to be done, if the system is still running in fair shape and is not dropping below the percentage that the Software Engineers figured out at what point the system ends up having to go do some housekeeping to bring it back to full potential.
     
    bro67, Apr 5, 2018
    #14
Thema:

&& Weirdness

Loading...
  1. && Weirdness - Similar Threads - Weirdness

  2. WEIRD ISSUE....

    in Windows 10 Gaming
    WEIRD ISSUE....: Hey thereso I got a really strange issue.my firefox browser is having weird lines on each corner except the top bar.and anyone tell me how to fix it?coz i tried uninstalling it and re-installing it again but nothing seems to work.I have other browsers installed but they don't...
  3. WEIRD ISSUE....

    in Windows 10 Software and Apps
    WEIRD ISSUE....: Hey thereso I got a really strange issue.my firefox browser is having weird lines on each corner except the top bar.and anyone tell me how to fix it?coz i tried uninstalling it and re-installing it again but nothing seems to work.I have other browsers installed but they don't...
  4. Weird error on laptop

    in Windows 10 Gaming
    Weird error on laptop: So there was this error that said memory isn't reading on my laptop I was so confused that I shut down my laptop Microsoft if you are reading this fix it https://answers.microsoft.com/en-us/windows/forum/all/weird-error-on-laptop/5bd1e7aa-44f9-4ab4-a784-d154819a3e6f
  5. Weird error on laptop

    in Windows 10 Software and Apps
    Weird error on laptop: So there was this error that said memory isn't reading on my laptop I was so confused that I shut down my laptop Microsoft if you are reading this fix it https://answers.microsoft.com/en-us/windows/forum/all/weird-error-on-laptop/5bd1e7aa-44f9-4ab4-a784-d154819a3e6f
  6. Weird error on laptop

    in Windows 10 BSOD Crashes and Debugging
    Weird error on laptop: So there was this error that said memory isn't reading on my laptop I was so confused that I shut down my laptop Microsoft if you are reading this fix it https://answers.microsoft.com/en-us/windows/forum/all/weird-error-on-laptop/5bd1e7aa-44f9-4ab4-a784-d154819a3e6f
  7. Why am I getting weird artifacting visual bugs when I change Windows security settings?

    in Windows 10 Gaming
    Why am I getting weird artifacting visual bugs when I change Windows security settings?: Build: https://pcpartpicker.com/list/CfHsGLSometimes, I get a weird artifacting visual bugt when I change my Windows 10 security settings. My PC freezes up for a second and then a line of something that looks like a QR code. It's all black and white. It looks staticky. Is...
  8. Why am I getting weird artifacting visual bugs when I change Windows security settings?

    in Windows 10 Software and Apps
    Why am I getting weird artifacting visual bugs when I change Windows security settings?: Build: https://pcpartpicker.com/list/CfHsGLSometimes, I get a weird artifacting visual bugt when I change my Windows 10 security settings. My PC freezes up for a second and then a line of something that looks like a QR code. It's all black and white. It looks staticky. Is...
  9. Why am I getting weird artifacting visual bugs when I change Windows security settings?

    in Windows 10 Drivers and Hardware
    Why am I getting weird artifacting visual bugs when I change Windows security settings?: Build: https://pcpartpicker.com/list/CfHsGLSometimes, I get a weird artifacting visual bugt when I change my Windows 10 security settings. My PC freezes up for a second and then a line of something that looks like a QR code. It's all black and white. It looks staticky. Is...
  10. Getting weird emails! What if anything should I do?

    in Windows 10 Software and Apps
    Getting weird emails! What if anything should I do?: I’ve been getting these ofd emails for the last 24 hours, its not me trying to sign in, what if anything should I do?“Hi **********@gmail.com,We received your request for a single-use code to use with your Microsoft account.Your single-use code is: *******If you didn't...