Over 1 million tech questions and answers.

Create a batch file to open a certain file in a certain file

Q: Create a batch file to open a certain file in a certain file

I would like to know if there is a way to open a file in a program. Basically I want something like this (this is totally wrong):

open "C:Users\*My name*\My Documents\run.swf" in "C:\Program Files (x86)\Mozilla Firefox\firefox.exe

Thanks

RELEVANCY SCORE 200
Preferred Solution: Create a batch file to open a certain file in a certain file

I recommend downloading and running Reimage. It's a computer repair tool that has been proven to identify and fix many Windows problems with a high level of success.

I've used it in the past to identify and fix everything from blue screens (BSOD's), ActiveX errors, corrupt files and processes, dll/exe/sys errors, recover lost memory, Windows update problems, defragging, malware removal etc.

You can download it direct from this link http://downloadreimage.com/download.php. (This link will automatically start a download of Reimage that you can save to your computer.)

A: Create a batch file to open a certain file in a certain file

The more standard way to do that is to use the start cmd. You call the program first and the file name second.

start "" "c:\windows\notepad.exe" "c:\somepath\logfile.txt"

Read other 2 answers
RELEVANCY SCORE 116

Dear All,

I need to create a batch file which can read the size of file(e.g. 1kb, 2kb...etc) from specific folder and detect 0kb file and convert it to text file (showing 0kb file size) with alarm.

I am not really sure how to write command for this batch file. Please help :-(
 

A:How to create a batch file to read size of file on specific folder path

Read other 10 answers
RELEVANCY SCORE 116

How to create a batch file that will move files based on the file type?

My Requirement : I need a batch file to copy all .doc files in all my HardDisk to a removable disk say (Z: drive) . Can anyone make it possible using a batch file?Please...Its urgent...

A:How to create a batch file that will move files based on the file type

Download XXCopy
XXCOPY, A Versatile File Management Utility --- Boldly Extended Xcopy
This is a vastly improved and extended version of DOS XCopy
Sorry, can't remember the syntax, but its quite simple if you read the manuel carefully :-)
Put the command line in a .bat file and it will run

Read other 4 answers
RELEVANCY SCORE 110

I have a computer that is a drone specifically for an outside LED sign. This computer is designed to never shut off and doesn't have any other program on it besides Operating System and the sign software. I need to create a batch file that I can place in the "start-up" folder that will open the program (LEDStudio10) and open the file that I want to play. I have already tried multiple attempts and I was hoping someone out there in sevenforums world would be able to point me in the right direction.

A:batch file open file for program in the startup folder

Task Scheduler. Create a new/basic task. You can invoke your batch script there. This can occur after boot completes, after user logon, etc. You can set it to run daily weekly hourly, etc. You can even have it delay X (preseleted time amounts) minutes/hours after boot/logon if you want.

Task Scheduler - Create New Task

Read other 1 answers
RELEVANCY SCORE 110

I want a batch to select and open a random link file in a folder i have. All the links are music videos I like to listen to, and I kind of want to just have an option for 'surprise me!'.
I can change the file names if I have to, and I have a basic batch file ability. I know the simple commands, but nothing of the variables, signs-involving commands (&%!?), etc.

Also, I want to learn a whole lot more about programming/java/batch file, so it'd be awesome if any code could be explained. Thank you, in advance

A:I need a batch file to open a random file within a certain folder/path

There's a free Windows scripting language called Autoit3 that would do this task easily using these functons:

Random
_FileListToArray

AutoIt - AutoItScript
It has a Basic like syntax and is easy to learn.

Another popular scripting for Windows is AutoHotkey
AutoHotkey: macro and automation Windows scripting language

The syntax can be confusing but it has object support and is more powerful.

Of course there are tons of others for Windows:
Rexx
Python
Perl
Ruby

Here's a list. The details for each tell which OS are supported:
Free Programming Languages - Freebyte's Guide to

Read other 5 answers
RELEVANCY SCORE 109.6

Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can...

First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg.

Here's the code that I'm using:

ffmpeg -i folder\video.mp4 -f mp3 -ab 160000 -vn "\different folder\music.mp3"

what I would like to do is add to this so that I don't have to write out this code for every file I have... :/

I have the mp4 files in one folder and than the mp3 files are saving to another folder.

So here's an example of what the code will do if it isn't clear yet.

Folder 1:

video1.mp4
video2.mp4
video3.mp4

what it should do is grab video1.mp4 and convert it.

ffmpeg -i folder\video1.mp4 -f mp3 -ab 160000 -vn "\different folder\music1.mp3"

and than move onto the next one

ffmpeg -i folder\video2.mp4 -f mp3 -ab 160000 -vn "\different folder\music2.mp3"

and than the next one

ffmpeg -i folder\video3.mp4 -f mp3 -ab 160000 -vn "\different folder\music3.mp3"

It's going to have to grab the name from the mp4 file and insert it for the mp3 file.

I can get around pretty good in cmd if it's basic commands but when it comes to something like this I'm a little confused...

Thanks for the help in advance!
I'll see what i can do about searching some more on what I would have to do and if I find the solution I'll post it here if it isn't already answered.

A:Batch File that grabs file names from folder to insert into batch file

A DOS "for /f" loop should do the trick, although changing the filename extension for the output to do everything in one line escapes me at the moment.

Perhaps you could do a dir .\folder\*.mp4/s/b > mp4s.txt, then make a copy of that and edit each line to rename the file to the destination name, and save it as mp3s.txt. Then you just feed both the source (mp4s.txt) and destination (mp3s.txt) filesnames into the for /f loop which handles the ffmpeg conversion.

Quite a crude solution and you'd have to handpatch the destination filenames, but i can't think of how to get a source mp4 filename and then just change the extension.

Read other 3 answers
RELEVANCY SCORE 108.8

Hi, I was wondering if it is possible to make a batch file that will open a file with a specific program?

Say I want to open "targetA.txt", with the program "noteviewer.exe"
Is it possible with batch file? or not?

If it is, could you please show me how?
 

A:making a batch file open a file with particular program?

Read other 10 answers
RELEVANCY SCORE 106

I bought a Western digital 2.5" portable hard drive with 120 GB of capacity. I have downloaded a back up file to it from my windows XP computer but I cannot open the bkf file to see what files were actually copied. The error message tells me I need to create a file association to open the bkf file and I don't know how to do that! Any suggestions?

My experience with the Western Digital support has been a waste of time.

Ron
 

A:Solved: create file extension to open bkf file

Read other 9 answers
RELEVANCY SCORE 102.4

Hi all,
I need help to create windows batch file for following requirements.
1. Remove .txt and .log file format in sub folders.
2. Zip individual file inside any sub folders and give file name through command prompt. 
3. Create sub folder zip file include file zip

Read other answers
RELEVANCY SCORE 102.4

Hi all,

Any idea how to write Batch File .bat to copy file from File Sharing & FTP Hosting to local directory.

Current the File Sharing & FTP Hosting is SMARTFILE.

I don't want to use WINSCP as the connector.

Thanks

A:Batch File .bat to copy file from File Sharing & FTP Hosting

Hi Chacha,

Give this batch file a try. All text in red, you should adjust before running.


Code:
@echo off
(
echo.Username
echo.Password
echo.lcd C:\Some\local\directory
echo.cd /Some/server/path
echo.binary
echo.get Some_file_to_download.txt
echo.bye
) > "%TEMP%\_%~n0.ftp"
ftp -s:"%TEMP%\_%~n0.ftp" "12.34.56.78"
del "%TEMP%\_%~n0.ftp"

Read other 1 answers
RELEVANCY SCORE 102.4

Hi,
I have a question  that how to copy file from remote desktop user drive to my local machine using  xcopy or any other protocol.

This is my server path "\\Trail01" and here is the file location "c:\Users\ashique.sheikh\Desktop\Day2.R"
How can i give this is in my batch file. I have used this
net use "\\Trail01" "[email protected]" "/USER:ashique.sheikh"
XCOPY /Y \\Trail01\c:\users\ashique.sheikh\Desktop\Day2.R  "D:\VMI"
But its not working. It is give path error.
How can i download this or is there any other way to do it?

Read other answers
RELEVANCY SCORE 100

Hi, i have a desktop computer and a laptop, my computer is on domain and laptop is not on domain,
now i need to access a folder on my desktop computer from my laptop , so if anyone would like to work in that folder they can click and open only that folder, for that i would like to create a batch file and i never did it, so please help me to create one, i will really appreciate it.
 

Read other answers
RELEVANCY SCORE 100

Hi Windows Expert,

May i know how to write a batch file that will copy a folder from local computer to a network shared folder and it will overwrite the existing folder in the network shared folder everyday?

Thanks.

Regards,

Read other answers
RELEVANCY SCORE 100

I want to know more about creating a batch file. From which websites i can read about the batch file creating.

if possible give me a link.
 

A:how to create a batch file

Rob's Website is one of my favorites for reference.
http://www.robvanderwoude.com/
 

Read other 1 answers
RELEVANCY SCORE 98.8

I generally run windows aero theme across all four monitors which i am happy with. However when i run a music app called cubase 5, i hear all sorts of squeaks and glitches when i simply move my cursor around the screen. The problem resolves itself when i switch to the standard windows classic theme.


My question is:

How do i write a simple windows batch file that when run by doubleclicking an icon will:

1) switch the theme to windows classic
2) run cubase.exe
3) switch back to windows aero theme when i exit cubase.


I appreciate you considering my query.

All the best.

Andy

A:Is it possible to create a windows batch file to do this?

Something like this should do
Code:
"%windir%\Resources\Ease of Access Themes\classic.theme"
"C:\location\cubase.exe"
tasklist | find "cubase.exe"
if errorlevel 1 "%windir%\Resources\Themes\aero.theme"
pause
Please change cubase filename and location for appropriate ones - I do not have that program.
Delete "pause" if you want cmd window to close upon completion too.

Personalization window will pop up, but that is a regular thing: it always pops up if you start theme file in any way.

Read other 4 answers
RELEVANCY SCORE 98.8

Hi, I need to create a batch file or even VB script that will put ~15 text files into separate strings (each text file contains 1 line of text) and then will compare these 15 strings and group them on based on identical strings. Is there any way this is possible? This is what I have got so far...I'm not sure if I am on the right track.
Code:
@Echo Off
SetLocal EnableDelayedExpansion
Set n=
Set InputFile=File1.txt
For /F "tokens=*" %%I IN (%InputFile%) DO (
Set /a n+=1
Set v!n!=%%I
)
EndLocal

 

A:Create Batch For File Comparison

Read other 6 answers
RELEVANCY SCORE 98.8

Hope this is the correct sub forum for this..

Often use a variety of command line functions e.g. winver / netplwiz etc etc

Is there a way of creating a batchfile to include multiple commands with a number option to select...would be so handy

i.e. 1 Netplwiz
2 Winver
3 ???
Thanks

Read other answers
RELEVANCY SCORE 98.8

I want to copy files from a folder to another folder named with system date. Actually, I want to such a batch file which gets executed when I click a button on desktop and complete the above task. Also, once created can I edit it, because opening .bat file tells that it is not a valid win32 file.

Read other answers
RELEVANCY SCORE 98.8
RELEVANCY SCORE 98.8

Just wondering if anyone could help me create this batch file. Have been trying for a while and is starting to really frustrate me. Any help would be greatly appreciated! Thanks.

? Create a batch file called myBackup.bat.
? It will backup all contents of a folder called 'files' to a folder called 'filesBackup'.
? If 'filesBackup' doesn't exist, it should create it.
? If 'filesBackup' is empty it should copy all files including subdirectories.
? If 'filesBackup' is not empty it should copy only newer files, without prompting.
? Don't use absolute paths, only relative folder names.
? You will need to use command line help to find the best command to use and what parameters to use. Copy command won't work, you will need a command that does eXtra.
? Paste the text of the batch file as well as a screen shot into your document.

A:Create Backup batch file, please help!!

Is this for a school assignment?

Why do you want to use relative directory? Why not use env variables?

Read other 2 answers
RELEVANCY SCORE 98.8

I want to make a batch file to run sfc /scannow & then restart the computer.
I use XP Home SP2.

I made one with sfc /scannow & shutdown -r but it restarts after sfc /scannow is just starting to run.

I need sfc /scannow to finish & then for the restart command to kick in.
The purpose is to let sfc /scannow to run & the computer to restart & run Error Checking & a boot time Avast scan.

I can set up the Avast & Error checking seperate from the .bat file.
They will run when the computer restarts.
Any help will be appreciated.
Thank you.

A:How To Create A Batch File With 2 Commands

Here is a web site - Making Batch Fileshttp://www.tnd.com/camosun/elex130/dosbatchtutor1.htmlHSould help with your problem.cya l8rThorXP

Read other 10 answers
RELEVANCY SCORE 98

I just have to empty a SD card; compressing its contents to a 7zip-file takes too much time, and if I have to access the files quickly, I prefer to use a mountable filetype. Thus the requirement to quickly create a VHDX-file, then mount it using the context
menu.
Tested using Windows 8.1 without Hyper-V-Role installed.
First, you need to create an empty vhdx-File as a template.
You already have to specify the maximum size this vhdx is allowed to expand to, in my case 255 GiB (255 GiB × 1024 MiB/GiB = 261120 MiB). This can be placed in either your user profile or shared for all users:

Current User: C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Templates\All Users: C:\ProgramData\Microsoft\Windows\Templates\
To create the template:
1. Start an elevated command prompt
2. Run diskpart.exe
3. Enter the following commands:
create vdisk file=C:\ProgramData\Microsoft\Windows\Templates\Virtual-Hard-Disk.vhdx type=expandable maximum=261120
attach vdisk
create partition primary
format fs=ntfs label="Blank Virtual Disk" quick
assign letter=z
detach vdisk
exit
4. Once the template is in place, just run this command:
reg.exe add HKCR\.vhdx\Windows.VhdFile\ShellNew /f /v FileName /t REG_SZ /d Virtual-Hard-Disk.vhdx
Voilą!
Now you just have to right-click in any file explorer window, also on remote network shares, select New > Hard Disk Image File and rename the file as you wish!

L.

Read other answers
RELEVANCY SCORE 98

Hello,
I tried to create a screen saver batch file, but when I execute it, it always open  the photo screensaver window.

what am I doing wrong, and how to corrected ? this is my script:
@echo off
start c:\Windows\System32\photoscreensaver.scr
start c:\Pictures
also please I need to know how to configure it to open the logo screen on the mouse movement.
I really appreciate  your help.

Thanks

Read other answers
RELEVANCY SCORE 98

Hello
I have been trying to create a shortcut to launch a batch file one folder up from the shortcut location.
I have been able to do this using and intermediate batch file in the same folder as the shortcut as follows:
Intermediate.bat:
@echo off
FOR %%V IN ("%~dp0..\") DO set curdrv=%%~dpV
start "" %curdrv%Oneup.bat

And the shortcut target is:
%windir%\system32\cmd.exe /c Intermediate.bat

and the 'Start in' is left blank.

This way I can move these folders anywhere on the drive or another drive and the shortcut still works.
However, I would like to leave out the Intermediate.bat file and launch the Oneup.bat directly. I tried:
%windir%\system32\cmd.exe /c FOR %%V IN ("%~dp0..\") DO set curdrv=%%~dpV && start "" %curdrv%Oneup.bat
in the Target of the shortcut, but it doesn't work.
Is there some trick to getting this to work?
Thanks

Read other answers
RELEVANCY SCORE 98

The batch file I am creating needs a command to create a temporary folder and then delete it when no longer needed. can this be done? How?
 
Bill

A:How to create a folder in a batch file,( .bat) and delete it

 Just use the mkdir command.  For the syntax just type mkdir /? from the command prompt.
 
Good luck.

Read other 3 answers
RELEVANCY SCORE 98

Hi,
Can anyone tell me how to create a batch file to run xcopy?
I want to copy d:files to y:backups.
Then I want to copy that to another PC on a network. If I just drag and drop, the copy fails every time because of errors in the files. This is a networked directory with many disfferent users!
I want to use this for backing up. I need to copy all files and subdirectories.
I think the command will be something like:
xcopy c:files y:backups /c /s /d
but I only got this by reading the Help section!
Thanks in advance!
Steve
 

A:[Solved] How to create a batch file to run xcopy?

Read other 15 answers
RELEVANCY SCORE 98

Hi, i need some help creating a batch file.

What i want it to do is to copy the folder structure of a specific folder, and then move the files and folders to the newly created folders.

As of right now i have this code:


Code:

echo on
xcopy "C:\Users\Test\Desktop\Origin\*" C:\Users\Test\Desktop\Destiny /T
move "C:\Users\Test\Desktop\Origin\*" C:\Users\Test\Desktop\Destiny/
pause
Currently it creates the folder structure, but only moves the files in C:\Users\Test\Desktop\Origin\ and not it's subfolders.

Any help would be appreciated

A:Create a batch to move file and folders

Sorry, my mistake.

Read other 3 answers
RELEVANCY SCORE 98

So I am looking to create some kind of batch file or script where I can click on it....it asks for the machine name, I enter it and then it displays the last logged on user. The following command
" wmic /NODE:"computername" computersystem get Username" gives me the desired results but I am trying to automate the process. I appreciate any help

A:How to Create a Batch file for last logged on for a remote use

Like this?

Code:
@ECHO OFF
SET MACHINENAME=%1
IF [%1]==[] GOTO SETNAME
GOTO END
:SETNAME
ECHO Type the machine name, press ENTER, Ctrl+Z, ENTER
FOR /F "tokens=*" %%A IN ('TYPE CON') DO SET INPUT=%%A
SET MACHINENAME=%INPUT%
:END
rem ECHO "%MACHINENAME%"
wmic /NODE:"%MACHINENAME%" computersystem get Username | find "\"
pause
Put that in a bat file and run it and it will ask for a machine name. The tricky thing is it needs a 3 step ENTER + Ctrl+Z + ENTER to exit the input mode. (that's the best I could do for a quick solution)

I made it so you can also call it with a parameter, then it won't ask for a machine name. Example:
C:\>GetLastUser.bat SERVER12
SERVER12\JOHN

Read other 8 answers
RELEVANCY SCORE 98

Hi there, In XP I used 2 batch files to create a popup reminder in a cmd window. I don't want to use a program like task manager as it requires to much input for the type of reminder I want. With these batch files I would run one of them, enter a time, enter a description and that was it. A cmd window would popup at the set time and show me whatever I had typed in the description. Quick and easy, no mucking around. I have tried to use them on W7 but they don't seem to work. Can someone please tell me if I can do this on W7 and how? Here are the details of the 2 batch files used in XP:

They both go in C:\Windows. Run setalarm.bat to create the reminder. Type time in 00:00 format and press Enter. Type description and press Enter.

1: setalarm.bat

@ECHO OFF
SETLOCAL
SET _t=%1
SET _d=%2 %3 %4 %5
SET _x=%_d: =%
IF NOT DEFINED _t (SET /P _t=Enter the time: )
IF NOT DEFINED _x (SET /p _d=Enter the description: )
IF NOT DEFINED _d (SET /p _d=Enter the description: )
ECHO. reminder at %_t% to %_d%
at \\%COMPUTERNAME% %_t% /interactive cmd /c showalarm "%_d%"

2: showalarm.bat

@echo off
cls
echo.
echo.
echo %1
echo.
echo.
pause

Cheers.

A:create a popup reminder using batch file

Oh woe is me. Can nobody help me with this?

Read other 9 answers
RELEVANCY SCORE 98

I need to copy several files from desktop to mapped network drive so here is simple bat file i wrote

copy %USERPROFILE%\Desktop\1.bd W:\backup\1.db

but it doesn't work... syntax error any help?



EDIT: ok error myself... it should be copy "%USERPROFILE%\Desktop\1.bd" W:\backup\1.db

Read other answers
RELEVANCY SCORE 98

After installing Vista, can a batch file be created that will configure services quickly instead of picking through them painfully slow?
 

A:how to create a batch file that will configure services

Read other 9 answers
RELEVANCY SCORE 98

What I want to do is a batch file or program so that when you open it, it mimics key presses Alt+Tab. Or at least tell me where's the Flip2D program location

I need it because I want my Synaptics touchpad to open it (this program) when a I press the upper left corner.

Thanks!

A:Create a batch file that mimics Alt+Tab key presses

Hello Mathius,

Here's an exe file I whipped up that acts a Flip2D shortcut that may work for you for this.

Flip 2D Shortcut Program

Hope this helps,
Shawn

Read other 1 answers
RELEVANCY SCORE 98

I'm trying to write a batch file that when run creates a folder named "Backup" followed by the time it was created, and then copies files to that folder.

When I run

md "C:\Users\MasterControlProgram\Documents\MC Server With Backup\Backups\Backup %DATE%\"
xcopy /e /v /y "C:\Users\MasterControlProgram\Documents\MC Server With Backup\Server\world" "C:\Users\MasterControlProgram\Documents\MC Server With Backup\Backups\Backup %DATE%\"
pause

It creates a folder named the date it was created and places the folders in it. How do I make it so the folder is named the time instead of the date?

A:Batch file to create a folder with name of the time.

you could do something like the below.
*disclaimer*: I am a fairly decent UNIX shell script programmer, but I suck at Windows programming. I did NOT test this out, but it should give you the general idea.

set SOURCEFOLDER="C:\Master"
set BACKUPTIME=%TIME%
set BACKUPFOLDER="C:\blah\Backup %BACKUPTIME%"

md "%BACKUPFOLDER%"
xcopy foo "%SOURCEFOLDER%" "%BACKUPFOLDER%"

Read other 2 answers
RELEVANCY SCORE 98

Does anyone know how I would write a batch file to pick at random one name from a list?

We want to be able to randomly choose a place to eat every Friday at work!

I have found some batch files written that are supposed to do this, but I cannot get them to work.

Thanks!
 

A:How do I create a Randomly Picking Batch File?

Why do it with a batch file? That's just masochistic.
Use Excel instead.. Any scientific calculator will do too. Even dice would be easier.
 

Read other 4 answers
RELEVANCY SCORE 96.8

Could somebody help me with a quick batch program to remove, network addresses, gateway, broadcast, etc.? Also include cookies, browser history and that sort of thing but really I want the network code if you could help out with that.

I know I could just use ccleaner but this is something that will be constantly worked on until all the functions I want will be in this one batch file instead of possibly running a couple programs.

Used these two but need to know from the experts!!

ipconfig /release
ipconfig /flushdns

Also when the the wireless card is pulled from the pcmcia slot, like to know what wipes any trace of the hard coded ip, mac ip.
 

A:Create a batch file to remove network activity

any help putting this code together for me. windows 7
 

Read other 1 answers
RELEVANCY SCORE 96.8

i saw an article on tech t.v. how to create a batch file to launch multiple programs, so i went into notepad, typed the paths of three programs i use every day at work, named it work.bat placed it on my desktop, but when i double click it the programs dont launch. an msdos window opens and lists the programs i want to launch, but nothing else happens, what am i doing wrong?
 

A:create a batch file to launch multiple programs

Read other 7 answers
RELEVANCY SCORE 96.8

Hey guys,

Any help with the captioned subject will be greatly appreciated.

Read other answers
RELEVANCY SCORE 96.8

I am using this command:

Code:
mount -u:root -p:[I][password][/I] \\216.17.1.125\srv\www\htdocs g:
at the command line to mount an NFS-enabled network drive from my Windows 7 machine.

I need to know what I need to put in a batch file (which will be put in my Startup folder), so the drive is automatically mounted at login/startup.

I tried just putting the line above in a batch file, but that didn't work.

Thanks for anyone's help.
 

A:How to Create Batch File to Mount Network Drive

Read other 16 answers
RELEVANCY SCORE 96.8

Hi Everyone,

I'm new to batch files but I want to create a batch file to run at startup on Windows 7 so when a user logs in with there username and password into the network to see if the Xerox 7535 network printer is installed and if it isn't to install it.

Now because these are computers that multiple users use frequently if I were to do this manually I would need the user to login to the network with there credentials and then open a window and type in //printer_server_name/ and a window would pop up and again they would have to type in there network credentials (username & password) then select the printer Xerox 7535 printer and right click on it and select connect and it would install the printer drivers if needed.

Now when I login as administrator to the computer I can connect to the printer server but when I try to connect/install to the Xerox 7535 printer it doesn't install and I get Error:"0x0000052e so instead I have to have each user login into the computer and install the printer which works that way.

I'm open to any other ways of doing this and I really appreciate the help.

Thanks,

Bill
 

A:How to Create a Batch file to install Network Printers

You can assign a logon script to each user on each computer, the script would be something like this:


Our example configure_printers.vbs script has the following:
Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\util-2\print-brother-1"
net.AddWindowsPrinterConnection "\\util-2\print-hpphoto-1"
' Set the default printer now
net.SetDefaultPrinter "\\util-2\print-hpphoto-1"

Save the file with a .vbs extension

To assign a logon script to a user or group
Open Computer Management.
In the console tree, click Users.
Where? System Tools/Local Users and Groups/Users
Double-click the user to which you want to assign a logon script.
Click the Profile tab.
In the Logon script field, enter the path and name of the logon script you want to assign to that user, and then click OK.


You can place a single copy of the script somewhere inside the Public user directory or you will need to place individual copies inside each user's subdirectory but bury it deep enough so the users won't accidentally delete it.
 

Read other 5 answers
RELEVANCY SCORE 96.8

I have been running the following batch file first on an XP machine (where it worked) and then on a Win 7 Pro 64 bit machine where it won't.  The c:\Data Files directory is a directory tree where I store all my data files from every application. 
The goal is to copy them at least daily to m:\, a 1TB  USB  NTFS backup drive.  The first time, it took about 7 to 8 hours.  Subsequent times (on XP), it frequently took a minute or less as I copy only the newer files (created or modified).
xcopy "c:\Data Files\Dave's Data\*.*"                                      
"m:\Dave's Data"                /R/D /E/H
I am using the same 1TB USB backup drive with my Windows 7 machine as with my older XP machine.  This command copies all files, directories (including empty), including read-only files, and hidden files from c:\Data Files to m:\

On the Windows 7 machine, the first files to be xcopied seem to copy ok.  They are just stand alone files in c:\Data Files.  But, xcopy then encounters c:\Data Files\Excel Data   and this is where it fails.  xcopy apparently tries
to create c:\Data Files\Excel Data   and quits when it can't do it.&... Read more

Read other answers
RELEVANCY SCORE 96.8

So, hey Brink, I guess there's no way to create a batch file which will switch to a particular resolution?

I find myself switching back and forth from 720p to 1080p frequently. Separate 1080.bat and 720.bat command files would be peachy for me. Or I should quit kvetching, and be a mench about the two extra clicks, huh?

Of course if all software vendors realized we were using such high resolutions and adapted accordingly, I wouldn't be changing my resolution at all.

Cheers, as always.

A:Create batch file that will switch to a particular screen resolution?

I think if you get nircmd you can do it relatively easy.
How to change Windows screen resolution using a command line | IndiaWebSearch.com

I use nircmd myself to open and close my old dvd drive because the button broke, it seems to work well.
After you have it it's just a matter of making a shortcut using the formula they provide on that page.

Read other 3 answers
RELEVANCY SCORE 96.8

create a batch file to format c drive on restart

--------------------------------------------------------------------------------

hi,

is it possible to create a batch file to format c drive on restart ?

if so

how would you create it

system im am wainting to try this on is windows xp..

thanks
 

Read other answers
RELEVANCY SCORE 96.8

I need to create a batch file to delete folders and the files that are in them. I have an application that is blowing up users profiles, not allowing them to log off until they reduce the profile size. Until I get a resolution from the application support team I need a batch file that I can send them that will delete two folders. Here is what I have to far and it is not working:

@echo off
deltree /y C:\Documents and Settings\SidesRJ\Documentum\ucf
deltree /y C:\Documents and Settings\SidesRJ\Documentum\cta
exit


Any help would be appreciated

A:Create a batch file to delete folders and files

deltree is a DOS/Windows 9x command.
In Windows NT 4 and higher (2000, XP, Vista, 7), you use rd /s (subdirectories)
If you want to do it without prompt you'd use the /q (quiet) flag
if you want to run it on different users' computers (with different usernames) use environment variables
to know what they are, open a command prompt window and type set
to access specific variables, use the % sign
for example in my computer, if you type %temp% in the address bar, it'll take you to that folder.

Read other 1 answers
RELEVANCY SCORE 96.8

Hi

I am using following batch file for cleaning the desktop and also for taking backup of desktop:

@echo off

set curr_date=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%

mkdir "%USERPROFILE%\My Documents\backup\%curr_date%_backup"

xcopy "%USERPROFILE%\Desktop" "%USERPROFILE%\My Documents\backup\%curr_date%_backup" /D/S/H/V/C/F/K/Y

for /d /r "%USERPROFILE%\Desktop" %%x in (*) do rd /s /q "%%x"
for /r "%USERPROFILE%\Desktop" %%x in (*) do del /f "%%x"

copy "%USERPROFILE%\My Documents\backup\%curr_date%_backup\*.lnk" "%USERPROFILE%\Desktop\"

del /q "%USERPROFILE%\My Documents\backup\%curr_date%_backup\*.lnk"

In the first line I am creating a folder with current date, e.g. curr_date_backup. Second, copying the contents of Desktop to the newly created folder. Third, deleting directories from the desktop. Forth, deleting files from the desktop. fifth, Copy back all the shortcuts to the desktop. sixth, deleting all the shortcuts from Current date folder.

This batch file is working perfectly in Windows XP. It works in win 7 also but the problem is that the name of the current date folder created by first command is "Desktop". when I use command prompt to check the name, the name is correct. I checked the properties of the folder the correct is there also. But in windows the name doesn't match with the expected one.

I need help. Kindly tell me what's going on? why window 7... Read more

A:How to create a current date folder using batch file?

Works for me, at least the first two commands work as advertised.

test.bat
set curr_date=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%
echo %curr_date%"

mkdir "%USERPROFILE%\My Documents\backup\%curr_date%_backup"
dir "%USERPROFILE%\My Documents\backup"






Quote:
C:\Users\xxxxxxx>set curr_date=2011-11-21

C:\Users\xxxxxxx>echo 2011-11-21"
2011-11-21"

C:\Users\xxxxxxx>mkdir "C:\Users\xxxxxxx\My Documents\backup\2011-11-21_backup"

C:\Users\xxxxxxx>dir "C:\Users\xxxxxxx\My Documents\backup"
Volume in drive C is D370_C
Volume Serial Number is C89E-70E8

Directory of C:\Users\xxxxxxx\My Documents\backup

11/21/2011 01:30 PM <DIR> .
11/21/2011 01:30 PM <DIR> ..
11/21/2011 01:30 PM <DIR> 2011-11-21_backup
0 File(s) 0 bytes
3 Dir(s) 28,082,577,408 bytes free

Read other 8 answers
RELEVANCY SCORE 96.8

Hi, all you computer geniuses! 
 
I have noticed that Win7 does not automatically remove the notification icons of uninstalled programs from the notification tray. I found instructions online to do it manually. I tried it and it works just fine. My question is, could a batch file be created the execute the steps and if so, how would it be written? Here are the steps (from www.ghacks.net):
 
Here is how you can remove old notification icons from the Windows 7 system tray.
Press [Windows R], type [regedit] and hit [enter]
Navigate to the Registry key HKCU \Software \Classes \LocalSettings \Software \Microsoft \Windows \CurrentVersion \TrayNotify
Make a backup of the Registry key by right-clicking on TrayNotify and selecting Export.
Now delete the following two Registry keys: IconStreams and PastIconsStream
Open the Windows Task Manager with [Ctrl Shift Esc]
Terminate the explorer.exe process
Click on File > New Task Run and enter explorer.exe to reload the explorer process

 
 
So the file would have to create the backup, delete the correct registry keys, and then kill and restart explorer.exe. 
 
Any ideas? (C'mon - I know you can do it!)   

A:Create a batch file to clean out the notification tray?

Copy this code to a notepad and save as bat file.This bat file would perfom the function
 
@echo off
reg export "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" %userprofile%\desktop\traynotify.reg /y
reg delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v IconStreams /f
reg delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v PastIconsStream /f
taskkill /f /im explorer.exe
start explorer.exe
exit

Read other 6 answers
RELEVANCY SCORE 96.8

Hi

I`m new around here and I have been given a task to update multiple computers with Microsoft updates offline. the updates will be sorted on a network drive. how do I create the bat file. if its possible to get the whole script on how to do that. I will be happy. thank u
 

A:how to create a batch file for offline updates [microsoft]

You would be better off setting up a WSUS server.
 

Read other 3 answers