Tag Info

Hot answers tagged

2

you can try taskkill /f /t /im "my portable app.dat" or append .exe to .dat


2

you can prepend start to the command in the script that will open it in a separate powershell console window instead of running inside cmd.exe or use that after the command $host.ui.rawui.windowtitle='new title' to change the title of powershell window


1

The volume label is encrypted too because it resides on the volume itself, so your only option would be using the volume GUID. Duplicate GUIDs are statistically very rare (See this thread on the subject), but you're saying your have several USB drives with the same GUID... I'd suggest you to use Diskpart and reinitialize the drives, thus creating a new ...


1

Assuming you are running this on "addsServer", so $profilePath is local to the machine, and D:\Profiles\username stores the user profile. $GoodbyeList = 'JDoe', 'KDoe', 'LDoe' $profilePath = 'D:\Profiles' foreach ($user in $GoodbyeList) { Remove-ADUser -Identity $user Remove-Item "$profilePath\$user" -Recurse -Force -Verbose }


1

I finally got it fixed. As I suspected, it was related to a (possibly) corrupt 64-bit DLL MSVCR80.DLL. I uninstalled all the "Microsoft Visual C++ 2005 Redistributable" packages (both 32 and 64 bit) via the regular uninstall screen from the Control Panel - I had 3 such packages. After this, everything returned to working order.


1

Based on some further googling results, adding $input | to powershell command seems to work, i.e.: C:\>(echo foo && echo bar) | powershell -Command "$input | %{$_ -replace \"f\",\"x\"}" xoo bar (note: when used in a .bat file, the % above needs to be replaced with %%, apparently)


1

I prefer fc > filename for this task. To work with non-empty files you can use fc >> filename fc is simply an alias for Format-Custom. I chose it because it is a short command that does nothing in this context, a noop. It is also nice because if you forget the redirect fc filename instead of giving you an error, again it just does nothing. ...


1

I too had this problem and I just fixed it by changing the system locale of my Windows installation English (United States). Swedish was apparently no supported with Lucide Console in PowerShell prompt. No idea why, but I blogged briefly about it here: http://www.meadow.se/wordpress/setting-the-font-of-a-powershell-console-to-lucida-console-wont-work/ Hope ...


1

This PowerShell script will create directories with numerically sequential names. function New-SequentialDirectory { Param ( [string] $Path = (Get-Location -PSProvider FileSystem).Path, [UInt32] $StartAt = 1, [UInt32] $EndAt ) $Path = (Get-Location -PSProvider FileSystem).Path if (-not (Test-Path -PathType Container $Path)) { $exception = ...


1

This is your user directory, for example if I as duDE execute this script I'll find it in C:/Users/duDE/XXXXXXXXX.csv : Get-ChildItem | Export-CSV XXXXXXXXX.csv


1

There are several registry values that control User Account Control: FilterAdministratorToken ConsentPromptBehaviorAdmin ConsentPromptBehaviorUser EnableInstallerDetection ValidateAdminCodeSignatures EnableLUA PromptOnSecureDesktop EnableVirtualization The combination of these values is what controls the slider in the GUI, or vice-versa. Reference: ...


1

Thank you very much, I got it. The following .REG file will set the UAC to Level 2. Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System] "ConsentPromptBehaviorAdmin"=dword:00000005 "ConsentPromptBehaviorUser"=dword:00000003 "EnableInstallerDetection"=dword:00000001 "EnableLUA"=dword:00000001 ...


1

Okay, turns out this is dead simple. Don't know why I didn't try it sooner, but I piped one of these KeyValuePair objects into Format-List, and got the following output: Key : Server1 Value : 1 So, it's as simple as addressing the object's Key parameter to find that value in my script.


1

In order to do this, the application must be designed to expose it's commands to external callers. Paint is not designed in this manner. It might still be possible to interact with Paint via PowerShell using the Automation APIs available in .NET but I have not investigated this personally.


1

If the program has shell verbs like Open, Print etc., you can invoke them.



Only top voted, non community-wiki answers of a minimum length are eligible