Jump to content

Yzöwl

Patron
  • Posts

    4,113
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United Kingdom

Everything posted by Yzöwl

  1. The setting of the execution policy is a one time only deal in normal use. You have decided however to now incorporarte this script as part of a WPI install; That is not something which necessitates the editing of my script. WPI can utilise the running of powershell scripts, you can set the execution policy to unrestricted prior to running this script. Search the WPI Forum for more information on how to do this. Are you sure that you are using WPI to install on an already running system with several users already configured with the application data directories you're intending to add to?
  2. Open Powershell as Administrator Type/Enter Set-ExecutionPolicy Unrestricted Try again! <Edit>You may find that an ExecutionPolicy of RemoteSigned is better for you.<Edit>
  3. That's not what you said in your first post! When you uninstall from Control Panel, you are actually doing exactly that, removing 'shortcuts'.
  4. I don't think that the response I provided is suitable for the example you've now provided. The following untested powershell script may work for you. $PathToMyFile = "MyFile.ext" $UserProfiles = GWmi Win32_UserProfile -filter "LocalPath Like '%\\Users\\%'" | Select-Object -ExpandProperty LocalPath ForEach ($Profile in $UserProfiles) { Copy-Item $PathToMyFile -Destination "$Profile\AppData\Roaming\IDMComp\UltraEdit" }
  5. COPY MyFile.ext %PUBLIC%
  6. As above, just shortened: @(ECHO/[Components]&ECHO/IEAccess=off)>"%TEMP%\_$.TXT" @SYSOCMGR /i:"%SYSTEMROOT%\INF\SYSOC.INF" /u:"%TEMP%\_$.TXT" @DEL "%TEMP%\_$.TXT"Remember that this doesn't remove IE just removes the default visible 'shortcuts' to it. If sysocmgr only parses specific sections of the answer file, the following script which doesn't write to a file may prove useful: @SYSOCMGR /i:"%SYSTEMROOT%\INF\SYSOC.INF" /u:%0 @GOTO :EOF [Components] IEAccess=off
  7. I just thought I'd say it in a batch file! MrryXmas.exe I've wrapped the file into an executable, it's a pure NT Command Script and appears to work on Windows 2000 through to Windows 8. You may need to answer prompts etc. or allow certain things in order to run it, use your own judgement. Microsoft Security Essentials auto deleted the above version when I put it on my desktop, this version, MrryXmas.exe, is allowed by the fore-mentioned program and may be more suited if your system behaves similarly! Enjoy!
  8. @CodeMe If you want a specific solution to 'learn from' then provide a specific question! (I can only provide a solution if you can provide me an exact character by character copy of the entries you need to modify/delete) The three lines you've provided us with are already commented out meaning that they are not read when the file is parsed and therefore do not need deleting! Are you suggesting that another game developer has written HOSTS entries which effectively block your domain!
  9. This is not a going to become a game where we try to ascertain your real question in order to provide the answer you want. Please provide us with a fully formed and informed question. How much faster do they run in an older Operating System?
  10. You cannot use shell: like that when you are not within the shell. One way, common to Windows XP through Windows 8 is to get the location from the registry using a batch file. @ECHO OFF & SETLOCAL ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION SET "SF_=SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\EXPLORER\USER SHELL FOLDERS" FOR /F "TOKENS=*" %%# IN ( 'REG QUERY "HKLM\%SF_%" /V "COMMON STARTUP"^|FIND "REG_"') DO SET "FL_=%%~#" CALL :SUB %FL_:*_SZ=% GOTO :EOF :SUB COPY "YourFile.ext" "%*"
  11. Just a quick follow up batch file using ideas from both jaclaz and allen2: @ECHO OFF & SETLOCAL ENABLEEXTENSIONS REM Change the line below to reflect your known IP string SET KIP=192.168.42 FOR /F "TOKENS=2 DELIMS=:" %%# IN ('IPCONFIG^|FINDSTR/I IP.*%KIP:.=\.%\.') DO ( CALL :SUB %%#) PAUSE GOTO :EOF :SUB ECHO=%*The SUB currently only shows you the relevant IP Address, you would obviously replace that with the code you wish to run, (and when you're happy REMove the PAUSE).
  12. The strings are saved in the registry and each receives an alphabet letter assignment. Unfortunately for you this means that there is only a 26 item buffer. If you need more then I'll suggest a couple of ideas. Use a third party application. Take Command for instance has a 4000 - 500000 Character History List Size Create a scripting solution which extracts your MRU registry information to a file, removes duplicates and propagates a scrollable or searchable listbox for injection into a new command session too much like hard work
  13. Yzöwl

    Batch Script

    Since you're using Windows 7 I'd suggest using powershell for this task. If your .msu files are all in one location then this powershell line may be sufficient for your needs. ls *.msu | %{start -wait $_ -argumentlist '/quiet /norestart'} If they're in individual directories within the working directory then use recurse ls *.msu -recurse | %{start -wait $_ -argumentlist '/quiet /norestart'} In either case run as Administrator FYI There is also a Powershell Module which may be of interest, see here. Footnote If you want something a little more advanced, the following code taken from Technet's discussion group will both download and update for you! <# .SYNOPSIS Get and optionally install Windows Updates .DESCRIPTION This script will get all available udpates for the computer it is run on. It will then optionally install those updates, provided they do not require user input. This script was based off the original vbs that appeared on the MSDN site. Please see the Related Links section for the URL. Without any parameters the script will return the title of each update that is currently available. .PARAMETER Install When present the script will download and install each update. If the EulaAccept param has not been passed, only updates that don't have a Eula will be applied. .PARAMETER EulaAccept When present will allow the script to download and install all updates that are currently available. .EXAMPLE .\Get-WindowsUpdates.ps1 There are no applicable updates Description ----------- This system is currently patched and up to date. .NOTES ScriptName : Get-WindowsUpdates.ps1 Created By : jspatton Date Coded : 08/29/2012 13:06:31 ScriptName is used to register events for this script ErrorCodes 100 = Success 101 = Error 102 = Warning 104 = Information .LINK https://code.google.com/p/mod-posh/wiki/Production/Get-WindowsUpdates.ps1 .LINK http://msdn.microsoft.com/en-us/library/windows/desktop/aa387102(v=vs.85).aspx #> [CmdletBinding()] Param ( [switch]$Install, [switch]$EulaAccept ) Begin { $ScriptName = $MyInvocation.MyCommand.ToString() $ScriptPath = $MyInvocation.MyCommand.Path $Username = $env:USERDOMAIN + "\" + $env:USERNAME New-EventLog -Source $ScriptName -LogName 'Windows Powershell' -ErrorAction SilentlyContinue $Message = "Script: " + $ScriptPath + "`nScript User: " + $Username + "`nStarted: " + (Get-Date).toString() Write-EventLog -LogName 'Windows Powershell' -Source $ScriptName -EventID "104" -EntryType "Information" -Message $Message # Dotsource in the functions you need. $UpdateSession = New-Object -ComObject 'Microsoft.Update.Session' $UpdateSession.ClientApplicationID = 'MSDN PowerShell Sample' } Process { $UpdateSearcher = $UpdateSession.CreateUpdateSearcher() $SearchResult = $UpdateSearcher.Search("IsInstalled=0 and Type='Software' and IsHidden=0") if ($Install) { Write-Verbose 'Creating a collection of updates to download:' $UpdatesToDownload = New-Object -ComObject 'Microsoft.Update.UpdateColl' foreach ($Update in $SearchResult.Updates) { [bool]$addThisUpdate = $false if ($Update.InstallationBehavior.CanRequestUserInput) { Write-Verbose "> Skipping: $($Update.Title) because it requires user input" } else { if (!($Update.EulaAccepted)) { Write-Verbose "> Note: $($Update.Title) has a license agreement that must be accepted:" if ($EulaAccept) { $Update.AcceptEula() [bool]$addThisUpdate = $true } else { Write-Verbose "> Skipping: $($Update.Title) because the license agreement was declined" } } else { [bool]$addThisUpdate = $true } } if ([bool]$addThisUpdate) { Write-Verbose "Adding: $($Update.Title)" $UpdatesToDownload.Add($Update) |Out-Null } } if ($UpdatesToDownload.Count -eq 0) { Write-Verbose 'All applicable updates were skipped.' break } Write-Verbose 'Downloading updates...' $Downloader = $UpdateSession.CreateUpdateDownloader() $Downloader.Updates = $UpdatesToDownload $Downloader.Download() $UpdatesToInstall = New-Object -ComObject 'Microsoft.Update.UpdateColl' [bool]$rebootMayBeRequired = $false Write-Verbose 'Successfully downloaded updates:' foreach ($Update in $SearchResult.Updates) { if ($Update.IsDownloaded) { Write-Verbose "> $($Update.Title)" $UpdatesToInstall.Add($Update) |Out-Null if ($Update.InstallationBehavior.RebootBehavior -gt 0) { [bool]$rebootMayBeRequired = $true } } } if ($UpdatesToInstall.Count -eq 0) { Write-Verbose 'No updates were succsesfully downloaded' } if ($rebootMayBeRequired) { Write-Verbose 'These updates may require a reboot' } Write-Verbose 'Installing updates...' $Installer = $UpdateSession.CreateUpdateInstaller() $Installer.Updates = $UpdatesToInstall $InstallationResult = $Installer.Install() Write-Verbose "Installation Result: $($InstallationResult.ResultCode)" Write-Verbose "Reboot Required: $($InstallationResult.RebootRequired)" Write-Verbose 'Listing of updates installed and individual installation results' for($i=0; $i -lt $UpdatesToInstall.Count; $i++) { New-Object -TypeName PSObject -Property @{ Title = $UpdatesToInstall.Item($i).Title Result = $InstallationResult.GetUpdateResult($i).ResultCode } } } else { if ($SearchResult.Updates.Count -ne 0) { $SearchResult.Updates |Select-Object -Property Title, Description, SupportUrl, UninstallationNotes, RebootRequired |Format-List } else { Write-Host 'There are no applicable updates' } } } End { $Message = "Script: " + $ScriptPath + "`nScript User: " + $Username + "`nFinished: " + (Get-Date).toString() Write-EventLog -LogName 'Windows Powershell' -Source $ScriptName -EventID "104" -EntryType "Information" -Message $Message }
  14. RD/S/Q "%USERPROFILE%\Documentum\UCF" RD/S/Q %SYSTEMDRIVE%\Cache\Java RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 10
  15. I have provided you with help by answering your questions.To recap: You asked if you could remove items from your %PATH% I gave you an answer to which I've received no recognition of having provided I provided you with possible corrections for your devcon command You told me that it didn't work Since devcon was not working I looked into other solutions for you. In order to do that I was forced to make assumptions since you have been less than forward with providing sufficient information on which to base our replies. I gave you another solution by implementing a registry change. You said that nothing happened You later stated that something did happen because you got an error message about the command line I gave you. There was nothing wrong with the command line I provided, however the solution was not appropriate for your purpose because you then decided to furnish us with a little more information. i.e. disable during typing. I responded with both a method for managing that problem and a scripting idea for solving your issue. You have the audacity to suggest I cannot help. One thing is for sure after the courtesy I've shown thus far, and your lack of it I will certainly think twice about providing you with any more help!
  16. Nobody is going to help you unless you start to provide true and proper feedback! From the command line, it said too many command line parameters. One of the above statements is obviously a lie!(There is also nothing wrong with the command line I provided)) Most touchpad software has a watch/keep alive monitor function which prevents it from being disabled through anything other than its own control panel applet and even then OEMs alter that applet and disable it even more.In order to prevent the touchpad interfering with typing you can adjust the sensitivity settings through your control panel applet, just keep altering the sensitivity level until it reaches a happy medium between funtionality and sensitivity for typing. I'm fairly certain that you will never be able to use devcon to disable your touchpad. Your goal is also a relatively 'one time only' action and therefore does not really require a scripting solution anyhow. If you really wanted that then create a script which captures your specific key presses whilst configuring using the GUI
  17. Your report is exactly what I would have assumed to have been the result since the command line I provided was not intended to do that.
  18. Both of my wife's lasson t two laptops, HP and Dell, did not disable the touchpad when another, USB, mouse was plugged in. Both input devices were enabled unless the touchpad was explicitly disabled. Cheers and Regards That is unfortunately expected, OEMs for some reason are responsible for this behaviour. I cannot help you if you do not follow the advice provided and report back with results.
  19. I think that the important question here is Why are you disabling your touchpad? Surely you need a mouse/pointing device! so the only logical reason for disabling the touchpad is that you have attached an alternative device. If that is the case then you should not need to disable the touchpad, it should do it all by itself when you connect the other device. Some drivers for the Synaptics touchpad have not always included that functionality by default but entering the following single line at a, administrator(if using Vista onwards), console window is reported to provide the required functionality. REG ADD HKLM\SOFTWARE\Synaptics\SynTPEnh /V DisableIntPDFeature /T REG_DWORD /D 51 /FYou will likely need to reboot your OS in order for the setting to take effect.
  20. Have you looked at using: %systemroot%\ie8\spuninst\spuninst.exeI have no idea if there are switches to make it silent or if it already does it silently.
  21. If your ID contains an ampersand, &, it must be enclosed in doublequotes, ", if your ID is an instance ID then it should be preceded by an at symbol, @. There is nothing wrong with the length of your path, by all means remove the duplicate entry if you wish however your computer may suffer worse issues if your software cannot find items due to removed locations in the path.
  22. I'm not sure that you understood the point I was making so I'll try to put it a different way. You are asking for a script which can stop a service, not a specific service but one or several of your choice at a time or times of your choosing and from either the desktop or start up location. It must also be able to start services, pause services and resume them too. In order for your script to be able to take a Service or Display Name of your choosing (as input), enumerate its state and start up settings, and present them for you in a manner for you to customise to your liking. It would need to be interactive, (it would have to be in a question and answer format). To do this it could be a basic question with written answer format or a more elaborate GUI with drop down boxes or toggles. In order to perform the changes your script would need to be able to determine whether or not your chosen service is capable of starting, stopping or pausing or resuming, (and has actually done so if chosen). It would need to check for dependencies which may be affected by or may themselves affect the selection you've chosen. To have a non interactive method would mean creating separate scripts for each task you want to perform, and since there are already methods of doing this using NET.EXE or SC.EXE you may be just as well advised creating small batch files than vb scripts using WMI.
×
×
  • Create New...