Modify registry

View: New views
8 Messages — Rating Filter:   Alert me  

Modify registry

by Kenneth C. Mazie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I realize that Mic has already done a lot to get this working.  Just
thougth I'd mention that I've found recently that a better method for
doing this is by using VBscript or PowerShell.  VBscript would be the
ideal choice since it's built into all current versions Windows, I've
retooled 95% of all my old batch scripts to VBscript these days and
it's far more versatile.  PowerShell will be the future replacement
for the DOS command prompt on Windows.  

A simple VB script to apply your setting on one system is as follows:

Option Explicit                                                      
        '<-- forces variables to be declared
Dim objShell, strKey, strValue, WshNetwork, strUserName, strServer  
        '<-- declare all variables
Set objShell = CreateObject("WScript.Shell")                        
        '<-- create a shell object
Set WSHNetwork = CreateObject("WScript.Network")                    
        '<-- create a network connection object
strUserName = WshNetwork.UserName                                    
        '<-- gets the domain user name
strServer = "storageserver"                                          
        '<-- set the server to use
strKey = ("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows
Messaging Subsystem\Profiles\" &_
"Sun Java System\cd90b1b8bae73945a1247fa102e57e32\001e6601")        
                    '<-- the key
strValue = "\\" & strServer & "\" & strUserName & "\SUNPST\NewPST.pst"
       '<-- the value and data using variables assigned from above
objShell.RegWrite strKey ,strValue, "REG_SZ"                        
        '<-- write the key
WScript.Quit                                                        
        '<-- exit

It can be expanded on of course to do about anything you want,
including remote updates, variable subsitution from a text file or the
local system variables, etc.  This is just a basic example.  As it is
shown it can be put on a users desktop for them to run.  You'd have to
customize it for the storage server name but it uses the domain user
name already.  I commented each line so you can see what it does.
Also the "&_" is just a "continue on next line" construct so you can
have long lines wrap within the code.  Just copy it into a text file
with a ".vbs" extention and double click it.  (Sorry if the formatting
is off)

Ken Mazie



Install hotfixes executables

by Aristos M. Vasiliou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I am currently using the following batch file to silently install microsoft hotfixes.

%~d0
pushd "\Software\Unattended\Install\Updates\XP\"
for /f "delims=" %%a IN ('dir *.exe /b') do "%%a" /q /n /z
popd

EXIT

Is there a way for this batch file to work, regardless of the path? Because I keep a copy on my USB stick, and one on a file server (to use on the network) and every time I make a change on either one and re-syncronize, one of them stops working because of the path.

Thanks



[Non-text portions of this message have been removed]


Re: Install hotfixes executables

by foxidrive-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 22 May 2009 14:47:03 +0300, "Aristos Vasiliou"
<aristos@...> wrote:


>Is there a way for this batch file to work, regardless of the path? Because I keep a copy on my USB stick, and one on a file server (to use on the network) and every time I make a change on either one and re-syncronize, one of them stops working because of the path.


Maybe this will do:

%~d0

if exist "\Software\Unattended\Install\Updates\XP\" (
set folder="\Software\Unattended\Install\Updates\XP\")

if exist "\usbdisk\Software\Unattended\Install\Updates\XP\" (
set folder="\usbdisk\Software\Unattended\Install\Updates\XP\")

pushd %folder%
for /f "delims=" %%a IN ('dir *.exe /b') do "%%a" /q /n /z
popd

EXIT



ftp get changes

by Aristos M. Vasiliou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am looking for a way to backup my ftp server, but only download the changes. I have a file named ftpscript.txt with the following contents:

open hostname.com
username
password
binary
cd /public_html/subfolder
lcd D:\backup\data
mget *.*
bye

and my batch file, backup.cmd is the following:

ftp -i -s:%~dp0ftpscript.txt

This will download everything, every time is run. How can I download only the changed and new files?

Thanks



[Non-text portions of this message have been removed]


Re: ftp get changes

by Parag P. Doke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I haven't tried this, but the script name suggests that it does
something similar.
http://www.dostips.com/DtTipsFtpBatchScript.php#Batch.FtpBatchGetNewFilesOnly

Parag P. Doke
http://paragpdoke.blogspot.com
Save paper, save trees. Do not print emails/documents unless
absolutely necessary.




On Fri, Jun 19, 2009 at 11:16 AM, Aristos Vasiliou<aristos@...> wrote:

>
>
> I am looking for a way to backup my ftp server, but only download the
> changes. I have a file named ftpscript.txt with the following contents:
>
> open hostname.com
> username
> password
> binary
> cd /public_html/subfolder
> lcd D:\backup\data
> mget *.*
> bye
>
> and my batch file, backup.cmd is the following:
>
> ftp -i -s:%~dp0ftpscript.txt
>
> This will download everything, every time is run. How can I download only
> the changed and new files?
>
> Thanks
>
> [Non-text portions of this message have been removed]
>
>

RE: ftp get changes

by Aristos M. Vasiliou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, thanks for replying.
 
This script needs me to define a filetype to download. I tried it with .php files and every time it connects it downloads them again. But even if it did work, it doesn't seem to go into subfolders to download recursively.
 
Thanks
 
Aristos

________________________________

From: batchworld@... on behalf of Parag P. Doke
Sent: Fri 6/19/2009 9:06 AM
To: batchworld@...
Subject: Re: [BATCH WORLD] ftp get changes





I haven't tried this, but the script name suggests that it does
something similar.
http://www.dostips.com/DtTipsFtpBatchScript.php#Batch.FtpBatchGetNewFilesOnly <http://www.dostips.com/DtTipsFtpBatchScript.php#Batch.FtpBatchGetNewFilesOnly>

Parag P. Doke
http://paragpdoke.blogspot.com <http://paragpdoke.blogspot.com/>
Save paper, save trees. Do not print emails/documents unless
absolutely necessary.

On Fri, Jun 19, 2009 at 11:16 AM, Aristos Vasiliou<aristos@... <mailto:aristos%40aristos.net> > wrote:

>
>
> I am looking for a way to backup my ftp server, but only download the
> changes. I have a file named ftpscript.txt with the following contents:
>
> open hostname.com
> username
> password
> binary
> cd /public_html/subfolder
> lcd D:\backup\data
> mget *.*
> bye
>
> and my batch file, backup.cmd is the following:
>
> ftp -i -s:%~dp0ftpscript.txt
>
> This will download everything, every time is run. How can I download only
> the changed and new files?
>
> Thanks
>
> [Non-text portions of this message have been removed]
>
>





[Non-text portions of this message have been removed]


RE: ftp get changes

by Marc Peterson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I use wget with the -N argument to do this.  Specifically in this case, it
looks like it would be something like this:
wget.exe -x -r -np --ftp-user=username --ftp-password=password -N
ftp://hostname.com/public_html/subfolder

Wget home page:
http://www.gnu.org/software/wget/

Wget for Windows:
http://gnuwin32.sourceforge.net/packages/wget.htm


--Marc Peterson


> -----Original Message-----
> From: batchworld@... [mailto:batchworld@...] On
> Behalf Of Aristos Vasiliou
> Sent: Friday, June 19, 2009 1:46 AM
> To: batchworld@...
> Subject: [BATCH WORLD] ftp get changes
>
> I am looking for a way to backup my ftp server, but only download the
> changes. I have a file named ftpscript.txt with the following contents:
>
> open hostname.com
> username
> password
> binary
> cd /public_html/subfolder
> lcd D:\backup\data
> mget *.*
> bye
>
> and my batch file, backup.cmd is the following:
>
> ftp -i -s:%~dp0ftpscript.txt
>
> This will download everything, every time is run. How can I download
> only the changed and new files?
>
> Thanks


RE: ftp get changes

by Aristos M. Vasiliou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It seems to be working great! Thank you for your help!

 

Aristos

 

From: batchworld@... [mailto:batchworld@...] On
Behalf Of Marc Peterson
Sent: Friday, June 19, 2009 4:35 PM
To: batchworld@...
Subject: RE: [BATCH WORLD] ftp get changes

 






I use wget with the -N argument to do this. Specifically in this case,
it
looks like it would be something like this:
wget.exe -x -r -np --ftp-user=username --ftp-password=password -N
ftp://hostname.com/public_html/subfolder

Wget home page:
http://www.gnu.org/software/wget/

Wget for Windows:
http://gnuwin32.sourceforge.net/packages/wget.htm

--Marc Peterson

> -----Original Message-----
> From: batchworld@... <mailto:batchworld%40yahoogroups.com>
[mailto:batchworld@... <mailto:batchworld%40yahoogroups.com>
] On
> Behalf Of Aristos Vasiliou
> Sent: Friday, June 19, 2009 1:46 AM
> To: batchworld@... <mailto:batchworld%40yahoogroups.com>
> Subject: [BATCH WORLD] ftp get changes
>
> I am looking for a way to backup my ftp server, but only download the
> changes. I have a file named ftpscript.txt with the following
contents:

>
> open hostname.com
> username
> password
> binary
> cd /public_html/subfolder
> lcd D:\backup\data
> mget *.*
> bye
>
> and my batch file, backup.cmd is the following:
>
> ftp -i -s:%~dp0ftpscript.txt
>
> This will download everything, every time is run. How can I download
> only the changed and new files?
>
> Thanks





[Non-text portions of this message have been removed]