4,693 reputation
1850103
bio website security.stackexchange.com
location Florida
age 32
visits member for 4 years, 2 months
seen 2 days ago

I'm not the droid you're looking for.


Sep
23
comment Managing a drive - searching for files that are rarely in use (so I can delete them for space)
If you're simply talking about similarity in command name alone, PowerShell has built-in aliases to re-direct many common CMD commands to the new PowerShell alternatives. (Example: dir calls Get-ChildItem.) PowerShell can also make direct use of most other native CMD commands, and many external commands, without any special accommodations needed.
Sep
23
comment Managing a drive - searching for files that are rarely in use (so I can delete them for space)
I get that DIR /T:A /OD might be familiar to CMD users, but I don't see how the DIR syntax, or the DIR filtering syntax should be. DEL /S in CMD does something completely different, and neither DIR nor DEL have any native filtering functionality similar to what is used here that I'm aware of or able to find.
Sep
23
comment Managing a drive - searching for files that are rarely in use (so I can delete them for space)
@RubenBaden \\ is just a UNC path designator to tell the system you're specifying a resource on the network instead of locally. As far as when it's finished, you'll know when it produces output and/or returns you to the command prompt. If output has been redirected to a file, you won't see it on-screen. After the command prompt re-appears, just open the output file.
Sep
23
comment Managing a drive - searching for files that are rarely in use (so I can delete them for space)
1. Get-ChildItem | Sort-Object LastAccessTime, 2. Get-ChildItem | Where-Object {$_.LastAccessTime.Year -le 2008}, 3. Get-ChildItem | Where-Object {$_.LastAccessTime.Year -le 2008} | Remove-Item -WhatIf, 4. Get-ChildItem | Where-Object {$_.LastAccessTime.Year -le 2008} | Remove-Item. Given that PowerShell is 100% free, comes with Windows 7+, has commands and parameters that are generally much more human-readable and human-parseable than the syntax in this answer, and has a built-in help system plus gobs of online community support, I'm not sure how it's more "daunting" than TCC.
Sep
23
comment Managing a drive - searching for files that are rarely in use (so I can delete them for space)
@RubenBaden Change C:\*path* to the network path you want searched. Example: \\FileServer\ShareName.
Sep
23
comment Way to list and cat all files that contain string X in powershell
@musher That's happening because, by default, Select-String returns all lines that match what you're looking for. Using the -Quiet parameter avoids that, and instead returns a simple Boolean value. The script in my answer also avoids the issue by using Select-String as part of another matching condition instead of actually taking the output directly.
Sep
23
comment Powershell script to open a number of files located inside subdirectories
@val I also suggest you try using PowerShell's built-in help functionality whenever you're having trouble with a command. The cmdlet is Get-Help. (Example: Get-Help Invoke-Item) Depending on what version of PowerShell you're using, you may need to Update-Help first.
Sep
23
comment Managing a drive - searching for files that are rarely in use (so I can delete them for space)
@RubenBaden Copy/paste.
Sep
23
comment Deleting all files that do not match a certain pattern - Windows command line
Note: PowerShell comes with Win 7/8. For Windows XP or Vista, you need to download and install it.
Sep
23
comment Deleting all files that do not match a certain pattern - Windows command line
From the CMD prompt, this should work: PowerShell.exe -Command "&{Remove-Item C:\MyFolder\* -Exclude '*.jpg'}"
Sep
23
comment how to boot without power button
Got a warranty? Send that sucker in before it expires and you're stuck with a broken power button for life!
Sep
23
comment how to boot without power button
Great idea... until the laptop runs out of power and shuts down completely one day.
Sep
23
comment Managing a drive - searching for files that are rarely in use (so I can delete them for space)
Nice job on the calculated value for Kbytes, too. I didn't realize you could do that.
Sep
23
comment Managing a drive - searching for files that are rarely in use (so I can delete them for space)
I'd suggest just dropping this on the PowerShell console, instead of running it as a PS1. Saves the hassle of having to work around ExecutionPolicy and such. I like the addition of Export-CSV!
Sep
23
comment Full permissions on folder when remoted in, but read only through the network
If your computer is not on the same domain, are you really supposed to be copying files from that server to your computer or vice-versa? Sounds like you may be trying to circumvent some corporate policy here.
Sep
23
comment Way to list and cat all files that contain string X in powershell
What kinds of files are these?
Sep
23
comment Way to list and cat all files that contain string X in powershell
Are you wanting the whole file contents, or just the lines containing the string? Also, what kind of files are these?
Sep
21
comment Run a command in a batch file on the system clock
Not sure if batch is really good for this. How do you feel about PowerShell?
Sep
19
comment Auto numbering based on repeating cells
It doesn't appear that your submissions have any naming or numbering system that can be used to identify duplicates. Is there something missing here?
Sep
16
comment DNS look up fail
...That will help you isolate the problem, to determine if it's due to your WiFi or other LAN components or something your ISP manages. If the first external device is the only one that drops, it's something on your ISP's network. If anything else drops, it's something on your network (though it might be the modem, which is usually the ISP's device - up to you to know what's what). If nothing drops, it could still be on your ISP's network but may be somewhere external to them - still, call your ISP.