Content Type
Profiles
Forums
Events
Everything posted by Yzöwl
-
The line you provided should work fine in a cmd window, however in a batch file try: @echo off move "%AllUsersProfile%\Start Menu\Programs\Alcohol 120%%" "%AllUsersProfile%\Start Menu\Programs\Burning Apps" goto :eof
-
Delete specific file on shutdown?
Yzöwl replied to JonesDK's topic in Unattended Windows 2000/XP/2003
Click Start » Run » (type) gpedit.msc » OK Then Computer Configuration » Windows Settings » Scripts (Startup/Shutdown) » (Double Click) Shutdown » Add and browse to your script etc. -
Here is a small list for you: %16386% is equivalent to %USERPROFILE%\Start Menu\Programs %16395% is equivalent to %USERPROFILE%\Start Menu %16400% is equivalent to %USERPROFILE%\Desktop %16406% is equivalent to %ALLUSERSPROFILE%\Start Menu %16407% is equivalent to %ALLUSERSPROFILE%\Start Menu\Programs %16409% is equivalent to %ALLUSERSPROFILE%\Desktop For what you have requested try replacing the entire [AddLink] section with the following [AddLink] setup.ini, progman.groups,, "group0=""%16407%\%APPZ%\""" setup.ini, group0,,"%APPZ%,""""""%16422%\%APPZ%\foobar2000.exe""""""" setup.ini, progman.groups,, "group1=""%16407%\%APPZ%\Help\""" setup.ini, group1,,"FAQ,""""""%16422%\%APPZ%\FAQ.html""""""" setup.ini, progman.groups,, "group2=""%16407%\%APPZ%\Help\""" setup.ini, group2,,"""Title Format"",""""""%16422%\%APPZ%\titleformat_help.html""""""" setup.ini, progman.groups,, "group3=""%16407%\%APPZ%\Help\""" setup.ini, group3,,"""DB Search"",""""""%16422%\%APPZ%\foo_dbsearch_help.html""""""" setup.ini, progman.groups,, "group4=""%16407%\%APPZ%\Help\""" setup.ini, group4,,"""Playlist Generator"",""""""%16422%\%APPZ%\foo_playlistgen_ex.html""""""" setup.ini, progman.groups,, ""group5="%16410%\%QLAUNCH%\""" setup.ini, group5,,"%APPZ%,""""""%16422%\%APPZ%\foobar2000.exe""""""" setup.ini, progman.groups,, "group6=""%16409%\""" setup.ini, group6,,"%APPZ%,""""""%16422%\%APPZ%\foobar2000.exe"""""""
-
I know nothing of this application, however from the above, I'm guessing that it's part of an additional component and if it doesn't exist will require removing from the relevant section in order to prevent the error message.
-
Don't forget the 3rd party Application stuff in the 'New' menu, you'll find it here HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Discardable\PostSetup\ShellNew
-
Look in the 'Strings' section, usually near or at the end [Strings] APPZ = "foobar2000"Therefore every time you see '%APPZ%' in the body of the inf it is replacing the string 'foobar2000'
-
Batch Script Tips and Tricks for XPCDs
Yzöwl replied to DarkShadows's topic in Unattended Windows 2000/XP/2003
Yes it should be %CDROM% the same way that %SYSTEMDRIVE% etc. works This would have to be tested, as I am aware of issues with setting environment variables using some methods, but it not being usable in the current session without a reboot. I am also unaware as to the earliest point in the UA setup, when the WMIC stuff will work. -
You could probably use something like this in vb script: Just change the red stuff to suit your specific application /process.
-
VBS Script to edit Registry
Yzöwl replied to frostbite1000's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
If you are wanting to add to the Run section of the registry, then something like this perhaps: Const constHKEY_LOCAL_MACHINE = &H80000002 Const constComputer = "." Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ constComputer & "\root\default:StdRegProv") strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" strValueName = "MyVal" strValue = "Drive:\PathTo\MyFile.ext" objReg.SetStringValue constHKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValueYou would simply need to change the strings 'strValueName' and 'strValue' to your specific needs -
Batch Script Tips and Tricks for XPCDs
Yzöwl replied to DarkShadows's topic in Unattended Windows 2000/XP/2003
@ DarkShadows wmic environment create Name="CDROM",UserName="<SYSTEM>",VariableValue="%%a">nulwhere%%a is the returned drive letter variable. Doing it automatically adds the following info to the registry e.g. [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment] "CDROM"="H:"Obviously with the correct drive letter! and it's also added to the system variables section of the environment variables window, from system properties » advanced. To later remove the variable, if you so wish, use: wmic environment where Name="CDROM" delete>nul <Edit> Using a mixture of both codes, this would do it @echo off&setlocal enableextensions wmic environment create Name="CDROM",UserName="<SYSTEM>",VariableValue="%~d0">nul endlocal&goto :eof</Edit> <Edit 2> Just changed some wording hopefully to help clarify some stuff </Edit 2> -
Batch Script Tips and Tricks for XPCDs
Yzöwl replied to DarkShadows's topic in Unattended Windows 2000/XP/2003
If I was likely to have more than one disk loaded, I wouldn't recommend the MediaLoaded method, but the VolumeName, thus negating that posibility. The example I gave only really used the WMIC method of getting the CD-ROM drive letter, because I wanted to show the thread readers a method of adding a new permanent system variable, which had never been shown before. As you said it was something which didn't always stick, I gave it as a valid alternative for XP+ systems. -
Batch Script Tips and Tricks for XPCDs
Yzöwl replied to DarkShadows's topic in Unattended Windows 2000/XP/2003
To the best of my knowledge, WPI is just a GUI for installing applications, it wasn't intended as a scripting interface. To read a registry key in js you would use something like this: var wsh = new ActiveXObject("WScript.Shell"); var key = "HKLM\\SOFTWARE\\Classes\\MadeUpKey"; wsh.RegRead(key)You would then need to be able to 'trap' the error messages in order to perform the run commands you need etc. <Edit> However to do what you want in cmd /batch REG QUERY "KeyName" /v "ValueName">nul 2>&1||regedit /s MyRegs.regJust input your own KeyName and Optionally ValueName, and of course change the name of the reg file to suit. </Edit> -
Batch Script Tips and Tricks for XPCDs
Yzöwl replied to DarkShadows's topic in Unattended Windows 2000/XP/2003
I may be wrong here but unless you set a permanent environment variable, due to the way each child cmd process automatically cleans-up on closing, your variable will only last until that specific window is closed.I'm not sure about permanent environment variables not staying set, but you could find the CD-ROM drive, (with CD loaded), and set it as a system variable with WMIC all at once. @echo off for /f "usebackq skip=1" %%a in ( `wmic cdrom where "MediaLoaded='TRUE'" get drive ^2^>nul` ) do ( if errorlevel 0 ( wmic environment create Name="CDROM",UserName="<SYSTEM>",VariableValue="%%a">nul ) ) goto :eof -
Batch Script Tips and Tricks for XPCDs
Yzöwl replied to DarkShadows's topic in Unattended Windows 2000/XP/2003
I'm not sure I like the idea of creating an additional directory. I would probably change it to something like this @echo off&setlocal enableextensions set MapCD=%SystemDrive%\_MapCD.cmd >%MapCD% echo/@echo off >>%MapCD% echo/set CDROM=%~d0 >>%MapCD% echo/goto :eof call %MapCD% if defined CDROM echo/%%CDROM%% is set as %CDROM% ping -n 4 127.0.0.1>nul&&endlocal&goto :eofIs it your intention to call the cmd file at the start of any subsequent batch which may require the CD-ROM location? -
In need of Printer remove script
Yzöwl replied to jeremyotten's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
What about WMIC? Delete Non-Local Printers: wmic printer where "Local='FALSE'" delete>nul 2>&1 Delete only Local Printers: wmic printer where "Local='TRUE'" delete>nul 2>&1 Delete all Printers: wmic printer delete>nul 2>&1 Martin you seem to be its biggest advocate here will the above do it? -
The RunOnce methods are run upon login. This will usually be on the Administrator account, however it depends more upon your Autologin and Count settings in your winnt.sif. <Edit> If PeterPiper is the name of the first person to login after setup has finished, then the batch file will run after PeterPiper has logged in (entering password if required). </Edit>
-
You can try, however the word 'special' and 'folder' tell me it probably will not work. The only way I have sucessfully seen My Music removed is unreg the mydocs.dll, make the change as per pawan's reply and to be safe create a hidden (system) file named My Music, (no extension), in My Documents folder
-
All you are in effect doing then Marthax, is renaming My Music to Music. Is it possible to rename 'special folders', yes! REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v CommonMusic /d "%ALLUSERSPROFILE%\Documents\Music" /f REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "My Music" /t REG_EXPAND_SZ /d "<drive:>\<path>\%%USERNAME%%\My Documents\Music" /f REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Music" /d "<drive:>\<path>\%USERNAME%\My Documents\Music" /fJust changing the path on the lower two examples would certainly be a good start.
-
This is how I used to do it from RunonceEx.inf - - - - - <snip> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HKLM,"%RunOnceEx%\install60",,,"Applying Security Template" HKLM,"%RunOnceEx%\install60",1,,"%11%\cmd /c copy ""%10%\security\Database\secedit.sdb"" ""%10%\security\Database\WinXPPro.sdb""" HKLM,"%RunOnceEx%\install60",2,,"%11%\cmd /c copy ""%24%\install\Security\WinXPPro.inf"" ""%10%\security\templates\""" HKLM,"%RunOnceEx%\install60",3,,"%11%\secedit /configure /db ""%10%\security\Database\WinXPPro.sdb"" /cfg ""%10%\security\templates\WinXPPro.inf"" /overwrite /log ""%10%\Temp\securcfg.log"" /quiet" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <snip> - - - - -The idea may help you with your particular setup
-
Is this what you wanted? for %* in (.) do @echo %~n* Here it is in a batch, (cmd), file to make it easier to test @echo off&setlocal enableextensions :: retrieving name of current directory for %%* in (.) do set MyDir=%%~n* :: adding safety factor for no directory, i.e a drive if not defined MyDir set MyDir=%CD:\=% :: telling you what it is echo/ the current directory is %MyDir% endlocal&goto :eof<Edit> After reading back your first post, it appears as if you are looking for the parent directory of the currently running batch file; this is not the same as the Current Directory and makes the previous response somewhat invalid. However the easiest way to do that is to first of all make the directory containing the batch file also the current directory @echo off&setlocal enableextensions&pushd %~dp0 for %%* in (.) do @echo %%~n* popd&endlocal&goto :eof </Edit>
-
@ clavicle The dll file is probably the one in use already the original questioner, Oh_Kay. However the Microsoft PowerToys file I linked to is also a dll file. The only problem with both of these examples is that we would prefer not to use a dll file. Not that there is anything wrong in you offering your file, just that it seems that the thread is re-covering old ground again, with little new being added.
-
@ praveenkumar_ht The Microsoft file I linked to at JSI, works, as does my vbs method above your reply, as also does this, also c/o JSI. Incidentally MHZ's code is identical to that already given by filthy_mcnasty
-
Here's an alternative, instead of using explorer to go to a folder containing the target, it just pops up a message box. First create this file and save it as %SystemRoot%\system32\GeTarget.vbs MsgBox CreateObject("WScript.Shell").CreateShortcut(WScript.Arguments (0)).TargetPathThe above should all be on one line. Now paste this into Start » Run and click OK REG ADD "HKCU\Software\Classes\lnkfile\Shell\Find Target\command" /ve /d "wscript.exe \"%SystemRoot%\system32\GeTarget.vbs\" \"%1\"" /fThis should be all one line also. Now right click any shortcut and choose Find Target
-
You could always use 'target' from Windows 95 Power Toys, (it still works on XP). It should be available from JSI,Inc - tip 8336