All Questions
Tagged with batch-file windows-server-2008
37 questions
1
vote
1
answer
2k
views
Run Bat file in Administrator Mode in Windows Server 2008
runas.exe /profile /user:administrator "C:\temp\SQLSP3.bat"
will run the SQLSP3.bat file in Administrative Prompt and it is asking Adminstrator password in Windows Server 2008.
SQLSP3.bat file has ...
1
vote
1
answer
342
views
Is there a way to run a script file that searches for files BUT excludes hidden files and folder?
I need to search some windows servers for files created after a certain date. I have set something up with forfiles but would like to speed up the process and reduce file size of the output file by ...
0
votes
1
answer
805
views
How to rar the newest (The latest modified date file) file?
I have the folder c:\AA\ that everyday there will be a new BAK file.
When I run the command it will re-rar every files not just the newest file.
I use this batch code:
FOR %%A IN (C:\AA\*.txt*) DO "...
-3
votes
1
answer
286
views
Install .EXE without displaying windows [closed]
I want to install an .exe file without displaying windows, by supplying value to parameters ? How can i do from Commands or script not in UI ?
-1
votes
1
answer
1k
views
Best Practices for User folder permissions [closed]
The following is my bat file. Is there a way I can substitute First.Last with usernames from a CSV file? My boss doesn't want to do all the users at once. He's afraid that something may happen so he's ...
0
votes
0
answers
2k
views
Error: "Parameter is incorrect" when opening 0b bat/cmd
Having sort of issue that is more likely annoying when need to create short batch script (though it's not scripting issue).
I want to right-click on desktop and create new text file. Rename it and ...
1
vote
1
answer
172
views
For in batch has weird behavior while reading folders
Im trying to do a simple batch (it is not the whole thing, but that's the part that is making everything fail)
@echo off
for /f "tokens=*" %%G in ('dir /s /b /a:d "e:\tmp\*"') do (
echo %%G
...
0
votes
1
answer
829
views
Batch script works on Windows 7 but not Windows Server 2008
Good Day Al
I have the following batch script that loops through a folder containing .sql files. When it finds a .sql file that has today's date timestamp on it, it copies that file to a new ...
0
votes
1
answer
403
views
Query in dsrm command
I need to remove 1000 computers from AD. I tried the script below, but it's not working. When I used dsmod to disable computers, in the same script, it works.
@echo off
set ComputerList=C:\Users\...
5
votes
1
answer
1k
views
Windows Task Scheduler cannot access EFS encrypted folder despite running as a user with access
I have a batch file set to run via Task Scheduler in Windows Server 2008 R2. The batch file is being used to rotate and compress MySQL logs, and the folder containing these logs is encrypted using ...
-1
votes
2
answers
224
views
Command only working when put directly in command prompt, not in batch file
On my SBS 2011 I have a batch file called wakeup-nas.bat, with the following contents:
wol.exe 5475e0d59ffa
wol.exe is an executable for sending wake on lan packets. It is in the same directory as ...
2
votes
1
answer
848
views
Test Multiple Server for login (WIndows 2008)
I currently run a PING sanity check test (batch file with result file) on over 80 servers in 4 environment.
But, even if we "ping" ok 100% of the servers, it doesn't mean that the machine are working ...
15
votes
1
answer
6k
views
Is MSIZAP still useful, or is it obsolete?
I update flash using MSI files installed by group policy. However, with every update, about a third of the workstations fail to update (Windows Vista and Windows 7 32/64-bit editions). In the event ...
1
vote
1
answer
3k
views
Pentaho Windows Batch file not running when executed on Windows Server 2008
I'm running a Pentaho Kettle Kitchen batch scripts on Windows Server 2008. When I launch the batch file, the Windows Command prompt pops up and then disappears. I've changed all files in the folders ...
2
votes
1
answer
684
views
Running a batch script as network services on windows
On linux I know you can run files under different users pretty easily but on Windows how do you do it? Do I have to log in under that user? Can I run it with the schedule system? I need to be able to ...
1
vote
1
answer
2k
views
batch file infinite loop when parsing file
EDIT: Apparently I don't have enough rep to answer my own question, so the answer is going here.
OKAY!
SO! I didn't exactly solve the problem... but I stopped using cacls.exe and started using ...
1
vote
1
answer
2k
views
Scheduled service/script/batch file to move files on condition of other files with similar filenames in same directory on windows
On Windows Server (Data Center? 2008?), i'm trying to set up a scheduled task that will:
Within a particular directory
For every file in it
If there exists (in the same directory) 2 files with ...
0
votes
1
answer
6k
views
ERRORLEVEL built-in no longer works on Windows Server 2008
Using a couple of servers at work running Windows Server 2008 and noticed that my batch scripts are no longer failing gracefully.
Put simply, any statement checking ERRORLEVEL seems to pass, no ...
1
vote
1
answer
2k
views
Win2008Server R2 - no window running .bat file via task scheduler
I'm running a couple of batch files via Task Scheduler that call rsync.
The .bat files work great when run manually and appear to be running fine via TS as well. HOWEVER, it does NOT open a cmd ...
0
votes
3
answers
1k
views
Batch file and other scripts on windows 2008 r2
is thee a way to make a all the scripts in a specific folder running without the need of the UAC prompt?
or maybe using power-shell to run the scripts without using "Set-ExecutionPolicy Unrestricted"
...
0
votes
3
answers
345
views
Windows Server 2008 R2 Scheduled Operations
Goodmorning everyone, I'm a newbie Windows 2008 s.a., and I'm stuck with a strange problem.
I've made a very simple bat file that stops the Apache HTTP Server, copies a file and then restart the ...
0
votes
2
answers
238
views
auto set permission on any file copied into folder
I have a batch file that copies folder from a temp directory to a public internet directory. The problem is, once the file is copied, the IUSR account doesn't have read privileges to the file and I ...
1
vote
2
answers
3k
views
Server 2008 issue running batch file
For the life of me, I can't seem to get a batch file running in Server 2008 Task Scheduler, despite it not having the common problems I've seen before.
Problem so far:
I have a batch file that takes ...
1
vote
1
answer
684
views
How to find out what is wrong with a Scheduled Task when it doesn't error
I have a number of batch files, which all work when ran separably to back up various Postgres dbs across the network. However when ran through task scheduler the backup files aren't created. There are ...
2
votes
3
answers
2k
views
Shortcut to open IIS 7 Manager so it Shows "Sites" view (status) by Default?
I would like to quickly be able to check whether a site is online after logging into the desktop of Windows Server 2008 R2 (x64). I would prefer to be able to do this in just 1 single or double-click (...
1
vote
1
answer
2k
views
Gracefully Terminate Console App Run Via Task Scheduler
I'm running a console application on Windows Server 2008. I want it to always run, so I have scheduled it to run at startup via the Task Scheduler. I set up the task so it does not require a login.
...
1
vote
3
answers
2k
views
.bat files to find all files on drive bigger than X
So far I run a .bat file to find all the media files stored on our student shared drive, which then writes to a .txt file in my documents, for example:
dir S:*.mp3 /s > "M:\logs\student\mp3.txt"
...
0
votes
1
answer
559
views
Making sure a batch is run with admin privileges
We use batch files to do simple installations of COM servers - mainly a few file copies and regsvr32s. Since regsvr32 writes to the registry's local machine hive, the batch must be run with ...
1
vote
1
answer
518
views
Batch File to delete contents of folder not modified in the last 3 days?
Anyone know of a script which I can execute with task scheduler which will allow me to delete the contents of a specified folder, but only the content that hasn't been modified for the last 3 days?
1
vote
1
answer
604
views
Why does appcmd.exe behave differently when executed inside a batch file?
I have the following appcmd to add an exception to IIS7's ISAPI and CGI restrictions. The exception I am adding should look like:
c:\perl\bin\perl.exe "%s" %s
Here is the command line:
appcmd set ...
1
vote
1
answer
277
views
Delete windows profiles with similar names using a batch file or script
I’m on a Windows 2008 server and would like to delete 15 users (user1 till user15) without having to do this by hand.
After deleting them completely I’d like to readd them (again, with a script) and ...
3
votes
1
answer
2k
views
Windows Server 2008 - Windows Server Backup - Email Alerts
I would like to create a script that emails me when a scheduled daily backup runs. I'd prefer the email to indicate success or failure. I understand that this is not an easy thing to do with Windows ...
5
votes
3
answers
3k
views
Windows Server 2008 - Calling FTP from .CMD - Pass a parameter to an FTP file?
I am calling the following from a .cmd file:
ftp -d -s:D:\backup\web-daily.txt
The web-daily.txt file is an ftp input file with similar contents to this:
open <server>
<login>
<...
3
votes
3
answers
5k
views
Windows Server 2008 CMD Task Schedule not running
I have a BAT/CMD file that when run from the command prompt runs completely. When I run it through the Task Scheduler it partially runs.
Here is a copy of the file
cd\sqlbackup
ren Apps_Backup*.* ...
1
vote
2
answers
5k
views
Does anyone have a Windows "at /every:" example to explain how to setup a batch file to run every day?
Microsoft documentation for the "AT" scheduler command shows that it has an /every: switch to schedule a script to reoccur on specified days. I've done it before, but I can't remember the syntax for ...
10
votes
5
answers
50k
views
run bat file at startup
How do I run a bat file at startup in Windows 2008?
25
votes
10
answers
300k
views
How to create a service running a .bat file on Windows 2008 Server?
I've created the service using
sc create myService binpath=myservice.bat
But when I start it, it fails with the following error message:
[SC] StartService FAILED 1053:
The service did not ...