I need find out the wall paper name that has been set in windows. using command through command prompt i need to find out wall paper name.consider an example, i have set somepicture.jpg as a wall paper. now by using a command through command prompt i should be able find the name of the wall paper(somepicture.jpg). is it possible? Please help me?
Thanks!
In Win7, path is stored in the registry key HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper. You can obtain it using
reg query "HKCU\Control Panel\Desktop" /v Wallpaper
But then you need a bit parsing of returned value.
in WinXP file name is 'C:\Documents and Settings\%USERNAME%\Local Settings\Application Data\Microsoft\Wallpaper1.jpg' (or bmp depending on image type).
Related
I'm looking for a way to set this option by using a batch or PS script.
While adding a new language to the registry key is super easy REG ADD "HKCU\Control Panel\International" /t REG_SZ /v LocaleName /d en-EN /f I didn't find any references on how to set the key to match the display language. I assume that this is a Windows Feature only and not bound to a key.
So do I really need to read out the Display Language Key reg query "HKLM\SYSTEM\CurrentControlSet\Control\MUI\UILanguages" first or is my assumption wrong and their really is a universal key to set it to the display language?
I do not know if there is a Registry key for that, but there is a Powershell cmdlet to change it.
Set-WinCultureFromLanguageListOptOut 0
Sets it to "Match Windows Display language (recommended)".
This is also the Default.
Set-WinCultureFromLanguageListOptOut 1
Sets it to what ever language you have currently enabled, e.g. English (United States).
Look here for more on that cmdlet: https://technet.microsoft.com/en-us/library/jj136913.aspx
And here for the other cmdlets regarding international Settings: https://technet.microsoft.com/en-us/library/hh852115.aspx
i recently found that wmic (windows management intrumentation command-line) existed :D, which is far better w/ more options than the regular "tasklist" in cmd that saves me time.
But i found a problem when exporting to .txt, is this: supposed to be that way? Because the first two letters of each line, are in the final part of each line... like here: .. is this a known "glitch/bug"? i couldn't find anything online that demonstrated this..
You have no problems with your files. You have a problem with notepad. There is a limit of 1024 characters in the length of the line. The 1025th character and following are moved to next line.
I'd suggest your problem is related to the fact that WMIC outputs unicode. I'd suggest piping the output through MORE.
I use `Editplus as an editor which appears to accept a unicode file quite happily. I'd suggest your editor isn't quite up to snuff.
MORE is a supplied utility - try more /? from the prompt for more info.
Processing your WMIC output through more is
wmic whatever | more >textfile
you might also try
for /f "delims=" %%a in ('wmic whatever') do >>textfile echo(%%a
(as a batch line - reduce %% to % to use from the prompt)
Notepad is a wannabe WP, wannabe editor. Tries to do both and does neither particularly well. Often gives problems in batch work. Since it's a supplied utility, there's no incentive to improve it - Microsoft simply doesn't have the funds.
Hence the availability of software from other vendors to do the task required.
I am a software tester and I often need to switch my short date format from M/dd/yy to d/M/yy because of Australian/New Zealand customers using a different date format. It is a pain in the ass to open up the clock, click change date and time, click change calendar settings, select the different date format from the drop-down and apply it before testing. Especially since when I am done I have to go through all of that again to set it back. This happens often enough that I want to automate the process like I have with some others (uninstall latest beta and installing the newest build, etc).
Does anyone know how I would go about accessing these settings in a batch file or in some kind of script?
Thanks!
reg add "HKCU\Control Panel\International" /f /v sShortDate /t REG_SZ /d "d/M/yy" >nul
echo %date%
It's better to change the user's registry instead of the global.
HKEY_USERS\.Default\Control Panel\International
try this reg key with REG add and such
Add or edit the sShortDate string value with
MM/dd/yyyy,
M/d/yy,
M/d/yyyy,
MM/dd/yy,
yy/MM/dd,
yyyy-MM-dd, or
dd-MMM-yy.
I need to create a script that does not rely on WMI, to perform the following actions:
Check if a registry value exist, and that it has the required type
If the registry value exist but of a wrong type, delete it
If the registry value does not exist, or was deleted in step #2, create it with a certain type
If the registry value exist and of the correct type, ensure that its value is correct
Nearly all Registry manipulation VBScript code snippets I found on the Internet relies on WMI. For certain reasons, this is not acceptable.
Do you have any recommendation on how to manipulate the Registry without relying on WMI?
VBScript/JScript from Windows Scripting Host (WSH) do have registry functions from WScript.Shell object, but they are limited to read, write, and delete key/value. There's no function to retrieve the existence of a registry key or value except by reading it and check the result. Function for retrieving a registry value type is also not present.
Other method of accessing the registry except from WMI object is to use the packaged REG.EXE command line tool via WScript.Shell.Exec function. This is done by using QUERY, ADD, DELETE, IMPORT, or EXPORT command parameter. Run REG.EXE to display the usage summary, or REG.EXE QUERY /?, REG.EXE EXPORT /?, etc. to display the command usage details.
The output of QUERY command would display the value data and its type, if it exists. The EXPORT command can also be used, except that it would save the result in a REG file. The result of REG.EXE tool can also be redirected into a file with the help of CMD.EXE. For example:
CMD.EXE /C REG.EXE QUERY "HKEY_CURRENT_USER\Control Panel\Cursors" > "reg output.txt"
Note that the contents of the output.txt are different than the contents of REG file. The REG file has standard format which is partially described in Microsoft Knowledge Base KB310516.
By checking the exit code of REG.EXE tool, and parsing either its output or a generated REG file, retrieving registry value types are possible. Registry manipulations that can be done using WScript.Shell object should be used if possible and if performance is a concern.
I have a process that writes log files and screenshots to a folder on a regular basis creating
between
30-50 files a week. The folder structure is ..\Year\Month\filename.ext, and it cannot be changed.
I'd like to create a shortcut to stick in my Favorites so I can get to this folder quickly but I need a variable for the YEAR and MONTH. Are there an environmental variables for this?
Any bright ideas on how I could create one that updates automatically preferably without a script or scheduled job?
The %DATE% environment variable holds the current date. You might be tempted to parse the date with %DATE:~6,4% to get the year.
But this method would not be very solid. %DATE% returns the current date using the windows settings for the "short date format". The problem is that the short date format setting is fully and endlessly customizable. One user can configure its system to show the short date as 29/06/2012; while another user (even in the same system) may choose Fri062912. It's a complete nightmare for a BAT programmer.
One possible solution is to use WMIC, instead. WMIC is the WMI command line interface to WMI. WMI Windows Management Instrumentation is the http://en.wikipedia.org/wiki/Windows_Management_Instrumentation
WMIC Path Win32_LocalTime Get Day,Hour,Minute,Month,Second,Year /Format:table
returns the date in a convenient way to directly parse it with a FOR.
Completing the parse and putting the pieces together
FOR /F "skip=1 tokens=1-6" %%A IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') DO (
SET /A MONTH=%%D
SET /A YEAR=%%F
)
your shortcut can point to a BAT file that includes the above code and then opens explorer on the right folder.
start "" "D:\FOLDER\%YEAR%\%MONTH%"