I want to run the open file in autorun.inf, but I can not. When I tried to shellexecute a .txt file, it opened, but in hidden mode. I found notepad.exe processes in Task Manager. I can't shellexecute .vbs file. But I can change the label and icon at my USB. Can anybody help me in this situation?
Related
I am trying to open a .chm file from a batch file.
The batch file has only this text in it :
echo off
start "S:\G.T.T\GTT-Vandemecum\Help Danny\GTT.chm"
If I run the batch file, the commandline opens but nothing further happens.
If I copy paste S:\G.T.T\GTT-Vandemecum\Help Danny\GTT.chm in start menu/run then it does works.
If I make a shortcut with target "S:\G.T.T\GTT-Vandemecum\Help Danny\GTT.chm" then it also works.
So the command works everywhere, except from a batch file.
What am I doing wrong here ?
It might also be important to know that when I start it from the shortcut, or start menu/runI always get a dialog
We can't verify who created this file. Are you sure you want to open this file ?
I am using Windows 7
EDIT
My problem is not the dialog, my problem is that nothing happens when I open the chm file from a batch file
The Start command is probably seeing your doublequoted string as a title, enter Start /? at the command prompt for its usage information.
Try adding an empty title first:
#Echo Off
Start "" "S:\G.T.T\GTT-Vandemecum\Help Danny\GTT.chm"
Trying to run a basic .bat file on my work machine. I have a file named chrome.bat that contains only the line start chrome. When I enter start chrome into CMD or PowerShell, it opens a new window of Chrome as one would expect. When I click on the .bat file, however, new instances of CMD are continuously created, no Chrome window is opened, and I have to hold CTRL-C until the process is killed.
Any insight?
Figured it out. The problem is that I named the file with the same name as the command. Renaming the file to blah.bat works just fine.
I created a .bat file that opens up a specific webpage I use for work in app mode on Chrome (so it removes the tabs and address bar to save space). I wanted to convert this .bat file to .exe (for a number of reasons that may seem pedantic). I used iexpress to convert the .bat to .exe. When I try to run the .exe the DOS window very briefly flashes and then crashes. I was able to grab a screenshot of the message as it was closing. The message is in the Title.
The script in my .bat is as follows:
#echo off
set "SystemPath=%windir%\System32"
if not "%ProgramFiles(x86)%"=="" set "SystemPath=%windir%\Sysnative"
start Chrome.exe --app=http:XXXXXXXXX
I added cmd /c to the "install program to launch" because I'm on Win 7. I opened the file in Notepad++ and it's encoded without BOM. I haven't been able to find another reason why my .bat file isn't being recognized.
some bat files need to be launched at the start of the session, but they don't.
Actually, when trying to launch one from the explorer, it opens the Open with window instead of just runnig.
However, the bat files still run correctly from the command prompt.
I bet it has been caused by a virus, but the antivirus did not detect anything unfortunately.
Any idea?
Use the Open With command, select cmd.exe, then before you hit OK, check the box that says "always use this program to open this type of file" or something similar.
If cmd.exe is not in the choices, browse to c:\windows\system32, and cmd.exe should be in there.
You can re associate the extension by downloading the reg file for batch from the link below which should solve your problem.
http://www.dougknox.com/xp/file_assoc.htm
I am using Windows 7 and have associated .svb files with C:\Windows\System32\wscript.exe which is the Windows Script Host program
But when I click the file I get the popup "There is no script engine for file extension .svb"
I have googled it but cold find a solution
Any ideas?
wscript.exe seems to be just a stub which itself calls the interpreter for Visual Basic Script, JavaScript etc. based on the file extension. You have associated the .svb extension with wscript.exe, but wscript.exe does not know what to do with it. That said, you probably have a typo there, and the file should be named .vbs (for Visual Basic Script) instead of .svb.
Create a VBScript file to play the sound.
Open Notepad and paste the following lines into it:
Set oVoice = CreateObject("SAPI.SpVoice")
set oSpFileStream = CreateObject("SAPI.SpFileStream")
oSpFileStream.Open "C:\Windows\Media\YourSoundHere.wav"
oVoice.SpeakStream oSpFileStream
oSpFileStream.Close
Save this file anywhere with a .VBS extension. For example, LogonSound.vbs.
Double-click the file you've created and ensure that it plays your sound file.
https://winaero.com/play-logon-sound-windows-10/