Content Type
Profiles
Forums
Events
Everything posted by Yzöwl
-
I still don't get why it is a requirement! After you've imported the reg settings, unless you actually change the location of %windir%, then having the data contain the variable serves no purpose, (especially since it is only for data to be read/executed once only at login.). Another thing you may like to look into if you are still insistent upon this pointless exercise is to import the registry data including variable as REG_SZ and see if the variable is read appropriately when read/invoked within the system.
-
GreenMachine's Complete SP3 SVCPACK.INF
Yzöwl replied to GreenMachine's topic in Unattended Windows 2000/XP/2003
It enables extended error reporting. -
Here's another example for testing, it has been included because the jaclaz version will not actually expand the variables to the console for viewing. @ECHO OFF & SETLOCAL SET "Prefix=2F16-" FOR /L %%A IN (1,1,32) DO CALL :SUB 10%%A ENDLOCAL & GOTO :EOF :SUB SET "Num=%1" ECHO ON ECHO=IF /I "%COMPUTERNAME%"=="%Prefix%%Num:~-2%" REGEDIT /s myreg%Num:~-2%.reg @ECHO OFF An actual working version would look a little like this: @ECHO OFF & SETLOCAL SET "Prefix=2F16-" FOR /L %%A IN (1,1,32) DO CALL :SUB 10%%A ENDLOCAL & GOTO :EOF :SUB SET "Num=%1" IF /I "%COMPUTERNAME%"=="%Prefix%%Num:~-2%" REGEDIT /s myreg%Num:~-2%.reg
-
I use PDF-Xchange Viewer, as my reader. I think you'll be pleasantly surprised with it.
-
The line you had was sending the letter y to a file with a name starting cacls. The one I gave was simply my interpretation of what I thought you meant to do which was to send a y as a response to the cacls command. In real terms I'm not aware of a reason why cacls would wait for a Y | N response so you should be able to start the line at cacls You would also have to ensure that users.txt existed %Pfad% was defined, (Probably %USERPROFILE%\..), and of course that the %USERNAME% from users.txt actually existed.
-
Deleting shortcuts in the Start/Programs menu
Yzöwl replied to chyronn's topic in Unattended Windows 2000/XP/2003
Nothing whatsoever! -
Printer Script Failing
Yzöwl replied to tech_boy's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
I would think that the most likely problem is with your installation inf file. Likely problems:You cannot use a network path for /f The network location specified in /f cannot be found. There is an error generated from the inf file. As far as the batch file goes, I'd personally prefer to see you keep everything in there instead of using a reg file merge, and possibly if using WMIC, sticking with it instead of using NET.EXE as well, e.g: @ECHO OFF REM Delete old printers except for Microsofts XPS Document Printer WMIC PRINTER WHERE "PortName <> 'XPSPort:'" DELETE REM Stop printer spooler if started WMIC SERVICE WHERE "Name='Spooler' AND State='Running'" CALL StopService REM Registry data changes SETLOCAL SET "KEY=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports" REM Delete old registry data REM REG DELETE "%KEY%" /VA /F REM Add new registry data REG ADD "%KEY%" /VE /F REG ADD "%KEY%" /V COM1: /D "9600,n,8,1" /F REG ADD "%KEY%" /V COM2: /D "9600,n,8,1" /F REG ADD "%KEY%" /V COM3: /D "9600,n,8,1" /F REG ADD "%KEY%" /V COM4: /D "9600,n,8,1" /F REG ADD "%KEY%" /V FILE: /F REG ADD "%KEY%" /V LPT1: /F REG ADD "%KEY%" /V LPT2: /F REG ADD "%KEY%" /V LPT3: /F REG ADD "%KEY%" /V Ne00: /F REG ADD "%KEY%" /V Ne01: /F REG ADD "%KEY%" /V Ne02: /F REG ADD "%KEY%" /V Ne03: /F REG ADD "%KEY%" /V \\juniorfs\JSchoolFL1 /F REG ADD "%KEY%" /V \\juniorfs\JSchoolVillach /F ENDLOCAL REM Start printer spooler WMIC SERVICE WHERE "Name='Spooler'" CALL StartService PAUSE... -
I'd like to highlight two things to you Andy. Please make sure that you make yourself aware of the Forum Rules, (particularly Rule 1.a) Taking note of the red text in the information box at the top of the WindowsXP Forum, would have also been prudent on this occasion. Topic Moved!
-
Why do you feel that registry value data of type REG_EXPAND_SZ is necessary?
-
Need a 3 choice cmd file
Yzöwl replied to Kelsenellenelvian's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
I remember in the distant past, a topic for batches/infs for 'right click - create ISO' it also had option(s) for data and boot ISOs. -
script-expanding variable to drive letter
Yzöwl replied to patronu's topic in Unattended Windows 2000/XP/2003
It doesn't even require a title, (just the quotes for one): START "" /wait "%TEMP%\RD\UPDATE\UPDATE.EXE" /q /n /z In fact it's very likely that you dont even need to use start at all! "%TEMP%\RD\UPDATE\UPDATE.EXE" /q /n /z -
script-expanding variable to drive letter
Yzöwl replied to patronu's topic in Unattended Windows 2000/XP/2003
Correct, but as I intimated earlier, keeping to a short/single command is not necessarily better/faster! -
script-expanding variable to drive letter
Yzöwl replied to patronu's topic in Unattended Windows 2000/XP/2003
It works fine on all of my operating systems!Try the following exactly as is, (as a verification check): @ECHO OFF & SETLOCAL ENABLEEXTENSIONS FOR /F "TOKENS=*" %%# IN ('IPCONFIG /ALL^|FIND "DHCP Server"') DO ( SET "DHCPSERVER=%%#" & CALL SET "DHCPSERVER=%%DHCPSERVER:*: =%%") ECHO=[%DHCPSERVER%] PING -n 6 127.0.0.1 1>NUL -
script-expanding variable to drive letter
Yzöwl replied to patronu's topic in Unattended Windows 2000/XP/2003
Yes you could also forget the counting too! FOR /F "TOKENS=*" %%# IN ('IPCONFIG /ALL^|FIND "DHCP Server"') DO SET "DHCPSERVER=%%#" & CALL SET "DHCPSERVER=%%DHCPSERVER:*: =%%" -
script-expanding variable to drive letter
Yzöwl replied to patronu's topic in Unattended Windows 2000/XP/2003
Just as long as you are aware that shorter scripts are not necessarily quicker/less resource intensive. BTW on Win2k, XP and Vista, in a console window the code you've chosen, which can be shortened as I had earlier, pre-edit, to delims=cdehprsv: ", uses "tokens=14, not 15. The results are not guaranteed to work in a manner I'd accept as safe for general use since there are 'hidden' characters in the ipconfig /all output. -
script-expanding variable to drive letter
Yzöwl replied to patronu's topic in Unattended Windows 2000/XP/2003
@jaclaz I think that number would be 15 @patronu, I would suggest that you forget about trying to make short or single line scripts and try one of these ideas: @Echo off & SetLocal EnableExtensions For /F "tokens=2 delims=:" %%# In ('IPConfig /all^|Find "DHCP Server"') Do ( Call :Addy %%#) Pause & Goto :Eof :Addy Set DHCPServer=%1 Echo=[%DHCPServer%] @Echo off & SetLocal EnableExtensions For /F "tokens=2 delims=:" %%# In ('IPConfig /all^|Find "DHCP Server"') Do ( For %%$ In (%%#) Do Set DHCPServer=%%$) Echo=[%DHCPServer%] Pause -
script-expanding variable to drive letter
Yzöwl replied to patronu's topic in Unattended Windows 2000/XP/2003
It seems like a problem caused by the OS I used, I've narrowed it down to be more specific and ran it on a Win2k system. Please see my previous edited post! -
script-expanding variable to drive letter
Yzöwl replied to patronu's topic in Unattended Windows 2000/XP/2003
Still you're not looking at the problem correctly, as stated by jaclaz and myself, the assigned dynamic address can have a differing number of characters. You can of course try something different with your for loop if you are trying to capture all the numbers and dots which make up the assigned address but without any whitespace. Try this: @Echo off For /F "tokens=14 delims=cdehprsv: " %%# In ( 'IPConfig /all^|Find "DHCP Server"') Do Set "_=%%#" Echo=net use x: \\%_%\testMake sure that the delims ends with <colon><tab><space>. -
script-expanding variable to drive letter
Yzöwl replied to patronu's topic in Unattended Windows 2000/XP/2003
It still isn't necessary to use such variable expansion techniques, just do it the other way around!FOR %%# IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO ( IF EXIST %%#:\install_usb.txt SET drive_path=%%#:\) ECHO=software_path=%drive_path%software\ For your additional question, let me just ask two things Why don't you want to capture all of the non-whitespace characters? How do you know that the DHCP Server will contain that specific number of characters? -
script-expanding variable to drive letter
Yzöwl replied to patronu's topic in Unattended Windows 2000/XP/2003
You've already set up the environment you need, just set the additional varaible within it! FOR %%# IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO ( IF EXIST %%#:\install_usb.txt ( SET drive_path=%%#:\ SET software_path=%%#:\software\)) -
This works perfectly for me! shortcut /f:"%userprofile%\Start\Programs\Command Lines\Append.lnk" /a:c /t:"%systemroot%\system32\cmd.exe" /p:"/k append /?"
-
The error message you were receiving was because the intended shortcut location does not exist!\Command Lines vs \Command Line The example you've given is also wrong! On my current Vista PC, the following would do as you require shortcut /f:"%userprofile%\Start\Programs\Command Lines\Ping.lnk" /a:c /t:"%systemroot%\system32\cmd.exe" /p:"/k ping"However using the Syntax suggested in the ReadMe.txt file you'd need this: shortcut /f:"%userprofile%\Start\Programs\Command Lines\Ping.lnk" /a:c /t:"^%systemroot^%\system32\cmd.exe" /p:"/k ping"Depending upon how you invoke the command and you particular system you may need to choose either one of the two!
-
With this: What is happening? Or I must use another system? The first error example is because you are using the wrong parameters. You are asking the application to create, (/a:c), a shortcut but have not provided it with a target for that shortcut, (/t:). The second example returns to one of your previous posts. You are asking for a shortcut to be created inside a location which does not exist, (\Command Lines).You need to firstly 'make the directory' for the location of that shortcut.
-
In my provided .inf file it is shown as a quoted string under infotip.If you're still talking about using OptimumX's shortcut.exe did you look at the syntax/parameter list provided in the ReadMe.txt and try: /D:description : Defines the description (or comment) for the shortcut.